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