SOAP Help

M

MR

I am in dire need of help in trying to get the client code for a web
service to work. i don't have a WSDL for the service so i created my own
ASP.NET service to test with. i converted the DTD files that i was given to
xsd files and used the xsd tool to create the classes. i used those classes
to create the parameters for the web method defined as follows:

[WebMethod]

publicSchema.submitOrderBatchResponse
submitOrderBatch(Schema.submitOrderBatch sob)

{

Schema.submitOrderBatchResponse sbor = new
Schema.submitOrderBatchResponse();

return sbor;


}

The proxy code is generated as:

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.ComponentModel.DesignerCategoryAttribute("code")]

[System.Web.Services.WebServiceBindingAttribute(Name="OrderOperationsSoap",
Namespace="http://tempuri.org/")]

public class OrderOperations :
System.Web.Services.Protocols.SoapHttpClientProtocol {


/// <remarks/>

public OrderOperations() {

this.Url = "http://localhost/Emulator/Emulator.asmx";

}


/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/submitOrderBatch",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

[return:
System.Xml.Serialization.XmlElementAttribute(Namespace="http://tempuri.org/submitOrderBatchResponse.xs")]

public submitOrderBatchResponse
submitOrderBatch([System.Xml.Serialization.XmlElementAttribute(Namespace="http://tempuri.org/submitOrderBatch.xs")]
submitOrderBatch sob) {

object[] results = this.Invoke("submitOrderBatch", new object[] {sob});

return ((submitOrderBatchResponse)(results[0]));







my client code works on the local host but when i go out to the real
service it fails.

i created the client in VS.NET 2003 and am referencing the web service that
i created.

I compared the logs of what i am sending to what i am supposed to send and
the SOAP headers appear to be missing some info and some of the tags are
wrong:



This is what is being sent from the proxy

<?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>

<submitOrderBatch xmlns="urn:OrderOperations">

<sob CustomerBatchID="122" xmlns="http://tempuri.org/submitOrderBatch.xs">

<Customer CustomerID="1097" OrderSource="NVL TEST CUSTOMER (CUSTOMER)" />
<Orders> . . .



This is what i should be sending in the body

<ns1:submitOrderBatch xmlns:ns1="urn:OrderOperations"

SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">

<orderBatchElement>



1) why does the first line show up? (?xml version ... etc.)

2) how can i get the correct SOAP headers?

3) how do i get the correct tags? ns1:submitOrderBatch
xmlns:ns1="urn:OrderOperations" instead of
xmlns="http://tempuri.org/submitOrderBatch.xs">

thanks very much
 
S

Steven Cheng[MSFT]

Hi MR,

Welcome to MSDN newsgroup.
Regarding on this issue, I've also found your another thread in the
microsoft.public.dotnet.framework.webservices
newsgroup. Another MSFT engineer has posted response there. Please feel
free to followup there if you have any further concerns or questions.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "MR" <[email protected]>
| Subject: SOAP Help
| Date: Sun, 21 Aug 2005 01:29:21 +0300
| Lines: 122
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <[email protected]>
| Newsgroups:
microsoft.public.dotnet.framework.webservices,microsoft.public.dotnet.langua
ges.csharp
| NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.languages.csharp:117451
microsoft.public.dotnet.framework.webservices:7585
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I am in dire need of help in trying to get the client code for a web
| service to work. i don't have a WSDL for the service so i created my own
| ASP.NET service to test with. i converted the DTD files that i was given
to
| xsd files and used the xsd tool to create the classes. i used those
classes
| to create the parameters for the web method defined as follows:
|
| [WebMethod]
|
| publicSchema.submitOrderBatchResponse
| submitOrderBatch(Schema.submitOrderBatch sob)
|
| {
|
| Schema.submitOrderBatchResponse sbor = new
| Schema.submitOrderBatchResponse();
|
| return sbor;
|
|
| }
|
| The proxy code is generated as:
|
| [System.Diagnostics.DebuggerStepThroughAttribute()]
|
| [System.ComponentModel.DesignerCategoryAttribute("code")]
|
|
[System.Web.Services.WebServiceBindingAttribute(Name="OrderOperationsSoap",
| Namespace="http://tempuri.org/")]
|
| public class OrderOperations :
| System.Web.Services.Protocols.SoapHttpClientProtocol {
|
|
| /// <remarks/>
|
| public OrderOperations() {
|
| this.Url = "http://localhost/Emulator/Emulator.asmx";
|
| }
|
|
| /// <remarks/>
|
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.o
rg/submitOrderBatch",
| RequestNamespace="http://tempuri.org/",
| ResponseNamespace="http://tempuri.org/",
| Use=System.Web.Services.Description.SoapBindingUse.Literal,
| ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
| [return:
|
System.Xml.Serialization.XmlElementAttribute(Namespace="http://tempuri.org/s
ubmitOrderBatchResponse.xs")]
|
| public submitOrderBatchResponse
|
submitOrderBatch([System.Xml.Serialization.XmlElementAttribute(Namespace="ht
tp://tempuri.org/submitOrderBatch.xs")]
| submitOrderBatch sob) {
|
| object[] results = this.Invoke("submitOrderBatch", new object[] {sob});
|
| return ((submitOrderBatchResponse)(results[0]));
|
|
|
|
|
|
|
| my client code works on the local host but when i go out to the real
| service it fails.
|
| i created the client in VS.NET 2003 and am referencing the web service
that
| i created.
|
| I compared the logs of what i am sending to what i am supposed to send
and
| the SOAP headers appear to be missing some info and some of the tags are
| wrong:
|
|
|
| This is what is being sent from the proxy
|
| <?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>
|
| <submitOrderBatch xmlns="urn:OrderOperations">
|
| <sob CustomerBatchID="122"
xmlns="http://tempuri.org/submitOrderBatch.xs">
|
| <Customer CustomerID="1097" OrderSource="NVL TEST CUSTOMER (CUSTOMER)" />
| <Orders> . . .
|
|
|
| This is what i should be sending in the body
|
| <ns1:submitOrderBatch xmlns:ns1="urn:OrderOperations"
|
| SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
|
| <orderBatchElement>
|
|
|
| 1) why does the first line show up? (?xml version ... etc.)
|
| 2) how can i get the correct SOAP headers?
|
| 3) how do i get the correct tags? ns1:submitOrderBatch
| xmlns:ns1="urn:OrderOperations" instead of
| xmlns="http://tempuri.org/submitOrderBatch.xs">
|
| thanks very much
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top