Re: How to resolve SOAP differences
- From: "Stefan Misch" <stefan.misch@xxxxxxxxxxxxxxxxx>
- Date: Thu, 25 Aug 2005 18:13:09 +0200
Mhh.. I don't know if this will help you, as my code is generated code from
the WSDL and I don't know where it could fit in your code, but here I go:
[System.Web.Services.WebServiceBindingAttribute(Name="SomeNameSoapBinding",
Namespace="SomeNS")]
public class KMURatingWsService :
System.Web.Services.Protocols.SoapHttpClientProtocol {
....
[System.Web.Services.Protocols.SoapRpcMethodAttribute("SomeMethod",
RequestNamespace="SomeNS", ResponseNamespace="SomeNS")]
[return:
System.Xml.Serialization.SoapElementAttribute("SomeMethodReturn")]
public ResultType SomeMethod(ParamType1 param1, ParamType2 param2) {
...
}
... classes for ParamType1, ParamType2 and ResultType like
[System.Xml.Serialization.SoapTypeAttribute("Param1Type", "SomeURL")]
public class Param1Type {
... just a sequence of int's and string's
}
}
Again, I doubt that this will help you very much, as the WSDL defines the
binding protcoll needed for accessing the WS. So the binding is something
that is defined in the WSDL. If you don't have a WSDL what would the binding
be good for?
Wouldn't it be better for you to construct your own XML, so that it matches
the XML SOAP envelope required by "their" web service and post the request
"by hand" using HttpWebRequest/HttpWebResponse. See
http://msdn.microsoft.com/msdnmag/issues/01/09/cweb/ as a first start.
"MR" <comconix@xxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:OZMUtCYqFHA.3108@xxxxxxxxxxxxxxxxxxxxxxx
> first i really appreciate your help, you cannot imagind how much time i
> have spent on this already.
>
> second, when i try to get the wsdl doc, i get the following error:
> SOAP RPC Router
> Sorry, I don't speak via HTTP GET- you have to use HTTP POST to talk to
> me.
> also i have asked them many times and they keep insisting that they don't
> have one
>
>
> third, the code you sent me was an improvement, i had gotten that far
> already. but what attributes do you have on the class?
> i have
> [WebService(Description = "Web Services Interoperability Test",Namespace =
> "urn:UserOperations")][SoapRpcService(RoutingStyle=SoapServiceRoutingStyle.SoapAction)]
> but it doens't work
> again thanks for your help so far
>
> "Stefan Misch" <stefan.misch@xxxxxxxxxxxxxxxxx> wrote in message
> news:ualZAMXqFHA.3540@xxxxxxxxxxxxxxxxxxxxxxx
>> The WS I'm talking to is hosted on an IBM Web application server and the
>> web server is an Apache server. So I guess my configuration is comparable
>> to yours.
>>
>> Again, I don't understand why you have no WSDL. I can access my WSDL
>> using IE and entering the web service's URL plus appending "?WSDL" at the
>> end, something like
>> "http://www.somedomain.xxx/Services/SomeService?WSDL". Please try that
>> before you do anything else.
>>
>> I added this WSDL-URL as a web reference to a sample VS C# console
>> application. VS generated everything I need to call the web service.
>> Calling the WS was as easy as:
>>
>> // initialize parameters
>> wsParameter.param1 = SomeValue1;
>> ...
>> wsParameter.paramX = SomeValueX;
>> // call web service
>> wsResult = wsSomeService.SomeMethod(wsParameter);
>>
>> The classes for wsParameter, wsResult and wsSomeService where generated
>> by VS based on the WSDL.
>>
>> BTW, looking into the generated classes I can see that the web method I'm
>> calling is RPC/encoded:
>> [System.Web.Services.Protocols.SoapRpcMethodAttribute("SomeMethod",
>> RequestNamespace="SomeURI", ResponseNamespace="SomeURI")]
>>
>>
>>
>> "MR" <comconix@xxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
>> news:eNHoqROqFHA.1136@xxxxxxxxxxxxxxxxxxxxxxx
>>> someone mentioned to me that the explanation is that the .NET default is
>>> rpc/encoded while that of apache servers is document/literal (or visa
>>> versa). what attribute do i use when i define my web methods to specify
>>> which format i want.
>>>
>>> "Stefan Misch" <stefan.misch@xxxxxxxxxxxxxxxxx> wrote in message
>>> news:%231aL4XLqFHA.3520@xxxxxxxxxxxxxxxxxxxxxxx
>>>> How do you construct your SOAP request and how do you send it? Have you
>>>> tried to use no NS at all? It could work, if the submitOrderBatch nodes
>>>> does not define any NS at all, but that depends on the WS server. Some
>>>> WS servers are a bit strict on the formal format of the SOAP message.
>>>>
>>>> I also don't understand why you have no WSDL. Normaly this is where VS
>>>> gets the information about the web service methods, types and
>>>> namespaces. Did you try to use the WS-address and append "?WSDL". Some
>>>> WS then offer the WSDL. Just try with your web browser and see what
>>>> happens.
>>>>
>>>>
>>>> "MR" <comconix@xxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
>>>> news:%23Nzop$KqFHA.2696@xxxxxxxxxxxxxxxxxxxxxxx
>>>>> you are probably right!
>>>>> i got rid of the http://tempuri.or, but how do i set the xmlns:ns1 in
>>>>> my webmethod? some attribute?
>>>>> i really appreciate your help on this. i have spent a lot of time and
>>>>> have gotten nowhere
>>>>> again thanks
>>>>> m
>>>>>
>>>>> "Stefan Misch" <stefan.misch@xxxxxxxxxxxxxxxxx> wrote in message
>>>>> news:%23fuk5PKqFHA.2952@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>> Are you sure that it's the "soap" instead of the "SOAP-ENV" that
>>>>>> causes the problem? After all these are just local namespace prefixes
>>>>>> for "http://schemas.xmlsoap.org/soap/envelope/". As long as this URI
>>>>>> is the same for the prefixes defined it should make no difference.
>>>>>>
>>>>>> I expect the problem could be the "submitOrderBatch" node. As "they"
>>>>>> define a NS with xmlns:ns1="urn:OrderOperations" but you define
>>>>>> xmlns="http://tempuri.org/", which is another NS. So "your" node
>>>>>> sumbitOrderBatch is not the submitOrderBatch they expect.
>>>>>>
>>>>>> Just a thought...
>>>>>> Stefan
>>>>>>
>>>>>>
>>>>>> "MR" <comconix@xxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
>>>>>> news:%23kUl5iBqFHA.3404@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>> my soap messages to a remote site are failing. as far as i can tell
>>>>>>> the only differences between what my SOAP message looks liek and
>>>>>>> what they want are in the SOAP envelope
>>>>>>> SInce they don't have a wsdl doc i created a localhost site based on
>>>>>>> their DTD documetns.
>>>>>>>
>>>>>>> How do I configure my site (and client proxy) to match thier
>>>>>>> envelope?
>>>>>>>
>>>>>>> Any help would be greatly appreciated
>>>>>>> thanks
>>>>>>> mr
>>>>>>>
>>>>>>> WHAT THEY WANT
>>>>>>>
>>>>>>> <?xml version="1.0" encoding="UTF-8" ?>
>>>>>>> - <SOAP-ENV:Envelope
>>>>>>> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>>>>>>> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
>>>>>>> xmlns:xsd="http://www.w3.org/1999/XMLSchema">
>>>>>>> - <SOAP-ENV:Body>
>>>>>>> - <ns1:submitOrderBatch xmlns:ns1="urn:OrderOperations"
>>>>>>> SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
>>>>>>>
>>>>>>> WHAT I AM SENDING
>>>>>>> <?xml version="1.0" encoding="utf-8" ?>
>>>>>>> - <soap:Envelope
>>>>>>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>>>>>>> - <soap:Body>
>>>>>>> - <orderBatchElement xmlns="http://tempuri.org/">
>>>>>>> - <submitOrderBatch CustomerBatchID="58"
>>>>>>> xmlns="http://tempuri.org/submitOrderBatch.xs">
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
.
- Follow-Ups:
- Re: How to resolve SOAP differences
- From: MR
- Re: How to resolve SOAP differences
- References:
- How to resolve SOAP differences
- From: MR
- Re: How to resolve SOAP differences
- From: Stefan Misch
- Re: How to resolve SOAP differences
- From: MR
- Re: How to resolve SOAP differences
- From: Stefan Misch
- Re: How to resolve SOAP differences
- From: MR
- Re: How to resolve SOAP differences
- From: Stefan Misch
- Re: How to resolve SOAP differences
- From: MR
- How to resolve SOAP differences
- Prev by Date: OracleAS Webservices and VB.NET
- Next by Date: DIME - Alive or Dead?
- Previous by thread: Re: How to resolve SOAP differences
- Next by thread: Re: How to resolve SOAP differences
- Index(es):