[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Complex soap messages with structures

Dan

8/29/2003 5:03:00 PM

Now I am really confused.

here is the stream going in

<SOAP-ENV:Envelope
xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envel...
xmlns:xsi="http://www.w3.org/1999/XMLSchema-inst...
xmlns:xsd="http://www.w3.org/1999/XMLSc...
xmlns:xe="urn:embrasure"
xmlns:xe1=" urn:VerifyStatus"
xmlns:xe2="http://schemas.xmlsoap.org/soap/encod...
>
<SOAP-ENV:Body>
<xe1:standard SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soa...
/" >
<xe1:key xsi:type="xe:messagekey">
<partnerkey
xsi:type="xsd:string">Embasure</partnerkey>
<companykey
xsi:type="xsd:string">PHTRopphile,disney</companykey>
</xe1:key>
</xe1:standard>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Here is the server response:
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envel...
xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst...
xmlns:xsd="http://www.w3.org/2001/XMLSchema...
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>

<faultstring>System.Web.Services.Protocols.SoapException:
Server was unable to read request. --->
System.InvalidOperationException: There is an error in XML
document (11, 6). ---> System.InvalidOperationException:
<standard xmlns=' urn:VerifyStatus'> was not expected.
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializat
ionReader1.Read17_standard()
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize
(XmlReader xmlReader, String encodingStyle)
at System.Xml.Serialization.XmlSerializer.Deserialize
(XmlReader xmlReader)
at
System.Web.Services.Protocols.SoapServerProtocol.ReadParame
ters()
--- End of inner exception stack trace ---
at
System.Web.Services.Protocols.SoapServerProtocol.ReadParame
ters()
at
System.Web.Services.Protocols.WebServiceHandler.Invoke()
at
System.Web.Services.Protocols.WebServiceHandler.CoreProcess
Request()</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>

What am I doing wrong!

te service is set up as :

/// Make service accessible from the outside
[WebService (Namespace="http://172.17.8.26/... )]
[SoapRpcService
(RoutingStyle=SoapServiceRoutingStyle.SoapAction)]

public class Service1 :
System.Web.Services.WebService

and the method is:

[ SoapRpcMethod(Action="standard",
RequestNamespace="VerifyStatus",
RequestElementName="standard",
ResponseNamespace="VerifyStatus",
ResponseElementName="standardResponse")]
// standard ping call with key passed for verifystatus
[WebMethod (Description="Validate SOAP server availability
and Message Key integrity")]

public messagekey standard(messagekey key)
{
messagekey kys = new keys();
//Make sure Embrasure is who is calling us
if(key.partnerKey.CompareTo("Embrasure") == 0)
{
// Validate the login and Embrasure
string[] ks = getkey(key.partnerKey, key.companyKey);

kys.partnerKey = ks[0];
kys.companyKey = ks[1];

}
return kys;

}

Why cant it see the namespace for the call!

HELP

Thanks
Dan

>-----Original Message-----
>OK, I am having a problem getting the xml to format for
>this soap message.
>
><SOAP-ENV:Envelope xmlns:SOAP-
>ENV="http://schemas.xmlsoap.org/soap/envel...
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-inst...
> xmlns:xsd="http://www.w3.org/1999/XMLSc...
> xmlns:xe="urn:mine"
> xmlns:xe1=" urn:VerifyStatus"
> xmlns:xe2="http://schemas.xmlsoap.org/soap/encod...
> >
> <SOAP-ENV:Body>
> <xe1:standard SOAP-
>ENV:encodingStyle="http://schemas.xmlsoap.org/so...
g
>/" >
> <xe1:key xsi:type="xe:messagekey">
> <partnerkey
>xsi:type="xsd:string">someguy</partnerkey>
> <companykey
>xsi:type="xsd:string">blah,blah</companykey>
> </xe1:key>
> </xe1:standard>
> </SOAP-ENV:Body>
></SOAP-ENV:Envelope>
>
>Can anyone help.
>
>here is the webmethod:
>
> [WebMethod (Description="Validate SOAP
>server availability and Message Key integrity")]
> [TraceExtension()]
> [SoapDocumentMethod
>("http://172.17.89.26/stan...,
>
>RequestNamespace="http://172.17.89.26/stan...,
>
>ResponseNamespace="http://172.17.89.26/standardResp...,
> Use=SoapBindingUse.Encoded)
> ]
>public keys standard([XmlElement("key")] messagekey key)
>{
> keys kys = new keys();
> //Make sure Embrasure is who is calling us
> if(key.partnerKey.CompareTo("Embrasure") == 0)
> {
> // Validate the login and Embrasure
> string[] ks = getkey(key.partnerKey, key.companyKey);
>
> kys.partnerKey = ks[0];
> kys.companyKey = ks[1];
>
> }
>return kys;
>
>}
>
>here is the messagekey class:
>[XmlRoot("key")]
>public class messagekey
>{
> public string partnerKey="";
> public string companyKey = "";
> public messagekey()
> {
> }
>}
>
>and the responding keys class
>[XmlRoot("return")]
>public class keys
>{
> public string partnerKey="";
> public string companyKey = "";
> [XmlElement("timestamp")]
> public DateTime timestamp;
> public keys()
> {
> timestamp=DateTime.Now;
> }
>
>}
>
>
><SOAP-ENV:Envelope xmlns:SOAP-
>ENV="http://schemas.xmlsoap.org/soap/envel...
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-inst...
> xmlns:xsd="http://www.w3.org/1999/XMLSc...
> xmlns:xe="urn:mine"
> xmlns:xe1=" urn:VerifyStatus"
> xmlns:xe2="http://schemas.xmlsoap.org/soap/encod...
> >
> <SOAP-ENV:Body>
> <xe1:standard SOAP-
>ENV:encodingStyle="http://schemas.xmlsoap.org/so...
g
>/" >
> <xe1:key xsi:type="xe:messagekey">
> <partnerkey
>xsi:type="xsd:string">someguy</partnerkey>
> <companykey
>xsi:type="xsd:string">blah,blah</companykey>
> </xe1:key>
> </xe1:standard>
> </SOAP-ENV:Body>
></SOAP-ENV:Envelope>
>
>the response should look like this.
><SOAP-ENV:Envelope
> xmlns:SOAP-
>ENV="http://schemas.xmlsoap.org/soap/envel...
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-inst...
> xmlns:xsd="http://www.w3.org/1999/XMLSc...
> >
> <SOAP-ENV:Body>
> <ns1:standardResponse xmlns:ns1="urn:VerifyStatus"
> SOAP-
>ENV:encodingStyle="http://schemas.xmlsoap.org/so...
g
>/">
> <return xmlns:ns2="urn:mine"
>xsi:type="ns2:messagekey">
> <partnerkey xsi:type="xsd:string">PARTNER
>KEY</partnerkey>
> <companykey xsi:type="xsd:string">COMPANY
>KEY</companykey>
> <timestamp xsi:type="xsd:date">YYYY-MM-DD
>HH24:MI:SS </timestamp>
> </return>
> </ns1:standardResponse>
> </SOAP-ENV:Body>
></SOAP-ENV:Envelope>
>
>
>I cant get the response nor does the method see the
>message object being passed in.
>
>Does any one have any ideas. I dont want to hack teh XML
>stream going out.
>
>Thanks
>Dan
>
>.
>
1 Answer

v-lwang

9/1/2003 1:15:00 AM

0

Hi Dan,

Thanks for your posting. I am checking this issue, and will get back to you
with my findings.

Best regards,
Lewis

--------------------
| Content-Class: urn:content-classes:message
| From: "Dan" <daniel_meland@msn.com>
| Sender: "Dan" <daniel_meland@msn.com>
| References: <0e2d01c36d84$51e9e6e0$a601280a@phx.gbl>
| Subject: Complex soap messages with structures
| Date: Fri, 29 Aug 2003 10:03:07 -0700
| Lines: 261
| Message-ID: <019801c36e4f$6afb6d40$a301280a@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNuT2r4Lxah9o6KQIOECwinUacaCA==
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:19100
| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| Now I am really confused.
|
| here is the stream going in
|
| <SOAP-ENV:Envelope
| xmlns:SOAP-
| ENV="http://schemas.xmlsoap.org/soap/envel...
| xmlns:xsi="http://www.w3.org/1999/XMLSchema-inst...
| xmlns:xsd="http://www.w3.org/1999/XMLSc...
| xmlns:xe="urn:embrasure"
| xmlns:xe1=" urn:VerifyStatus"
| xmlns:xe2="http://schemas.xmlsoap.org/soap/encod...
| >
| <SOAP-ENV:Body>
| <xe1:standard SOAP-
| ENV:encodingStyle="http://schemas.xmlsoap.org/soa...
| /" >
| <xe1:key xsi:type="xe:messagekey">
| <partnerkey
| xsi:type="xsd:string">Embasure</partnerkey>
| <companykey
| xsi:type="xsd:string">PHTRopphile,disney</companykey>
| </xe1:key>
| </xe1:standard>
| </SOAP-ENV:Body>
| </SOAP-ENV:Envelope>
|
|
| Here is the server response:
| <soap:Envelope
| xmlns:soap="http://schemas.xmlsoap.org/soap/envel...
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst...
| xmlns:xsd="http://www.w3.org/2001/XMLSchema...
| <soap:Body>
| <soap:Fault>
| <faultcode>soap:Client</faultcode>
|
| <faultstring>System.Web.Services.Protocols.SoapException:
| Server was unable to read request. --->
| System.InvalidOperationException: There is an error in XML
| document (11, 6). ---> System.InvalidOperationException:
| <standard xmlns=' urn:VerifyStatus'> was not expected.
| at
| Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializat
| ionReader1.Read17_standard()
| --- End of inner exception stack trace ---
| at System.Xml.Serialization.XmlSerializer.Deserialize
| (XmlReader xmlReader, String encodingStyle)
| at System.Xml.Serialization.XmlSerializer.Deserialize
| (XmlReader xmlReader)
| at
| System.Web.Services.Protocols.SoapServerProtocol.ReadParame
| ters()
| --- End of inner exception stack trace ---
| at
| System.Web.Services.Protocols.SoapServerProtocol.ReadParame
| ters()
| at
| System.Web.Services.Protocols.WebServiceHandler.Invoke()
| at
| System.Web.Services.Protocols.WebServiceHandler.CoreProcess
| Request()</faultstring>
| <detail />
| </soap:Fault>
| </soap:Body>
| </soap:Envelope>
|
| What am I doing wrong!
|
| te service is set up as :
|
| /// Make service accessible from the outside
| [WebService (Namespace="http://172.17.8.26/... )]
| [SoapRpcService
| (RoutingStyle=SoapServiceRoutingStyle.SoapAction)]
|
| public class Service1 :
| System.Web.Services.WebService
|
| and the method is:
|
| [ SoapRpcMethod(Action="standard",
| RequestNamespace="VerifyStatus",
| RequestElementName="standard",
| ResponseNamespace="VerifyStatus",
| ResponseElementName="standardResponse")]
| // standard ping call with key passed for verifystatus
| [WebMethod (Description="Validate SOAP server availability
| and Message Key integrity")]
|
| public messagekey standard(messagekey key)
| {
| messagekey kys = new keys();
| //Make sure Embrasure is who is calling us
| if(key.partnerKey.CompareTo("Embrasure") == 0)
| {
| // Validate the login and Embrasure
| string[] ks = getkey(key.partnerKey, key.companyKey);
|
| kys.partnerKey = ks[0];
| kys.companyKey = ks[1];
|
| }
| return kys;
|
| }
|
| Why cant it see the namespace for the call!
|
| HELP
|
| Thanks
| Dan
|
| >-----Original Message-----
| >OK, I am having a problem getting the xml to format for
| >this soap message.
| >
| ><SOAP-ENV:Envelope xmlns:SOAP-
| >ENV="http://schemas.xmlsoap.org/soap/envel...
| > xmlns:xsi="http://www.w3.org/1999/XMLSchema-inst...
| > xmlns:xsd="http://www.w3.org/1999/XMLSc...
| > xmlns:xe="urn:mine"
| > xmlns:xe1=" urn:VerifyStatus"
| > xmlns:xe2="http://schemas.xmlsoap.org/soap/encod...
| > >
| > <SOAP-ENV:Body>
| > <xe1:standard SOAP-
| >ENV:encodingStyle="http://schemas.xmlsoap.org/so...
| g
| >/" >
| > <xe1:key xsi:type="xe:messagekey">
| > <partnerkey
| >xsi:type="xsd:string">someguy</partnerkey>
| > <companykey
| >xsi:type="xsd:string">blah,blah</companykey>
| > </xe1:key>
| > </xe1:standard>
| > </SOAP-ENV:Body>
| ></SOAP-ENV:Envelope>
| >
| >Can anyone help.
| >
| >here is the webmethod:
| >
| > [WebMethod (Description="Validate SOAP
| >server availability and Message Key integrity")]
| > [TraceExtension()]
| > [SoapDocumentMethod
| >("http://172.17.89.26/stan...,
| >
| >RequestNamespace="http://172.17.89.26/stan...,
| >
| >ResponseNamespace="http://172.17.89.26/standardResp...,
| > Use=SoapBindingUse.Encoded)
| > ]
| >public keys standard([XmlElement("key")] messagekey key)
| >{
| > keys kys = new keys();
| > //Make sure Embrasure is who is calling us
| > if(key.partnerKey.CompareTo("Embrasure") == 0)
| > {
| > // Validate the login and Embrasure
| > string[] ks = getkey(key.partnerKey, key.companyKey);
| >
| > kys.partnerKey = ks[0];
| > kys.companyKey = ks[1];
| >
| > }
| >return kys;
| >
| >}
| >
| >here is the messagekey class:
| >[XmlRoot("key")]
| >public class messagekey
| >{
| > public string partnerKey="";
| > public string companyKey = "";
| > public messagekey()
| > {
| > }
| >}
| >
| >and the responding keys class
| >[XmlRoot("return")]
| >public class keys
| >{
| > public string partnerKey="";
| > public string companyKey = "";
| > [XmlElement("timestamp")]
| > public DateTime timestamp;
| > public keys()
| > {
| > timestamp=DateTime.Now;
| > }
| >
| >}
| >
| >
| ><SOAP-ENV:Envelope xmlns:SOAP-
| >ENV="http://schemas.xmlsoap.org/soap/envel...
| > xmlns:xsi="http://www.w3.org/1999/XMLSchema-inst...
| > xmlns:xsd="http://www.w3.org/1999/XMLSc...
| > xmlns:xe="urn:mine"
| > xmlns:xe1=" urn:VerifyStatus"
| > xmlns:xe2="http://schemas.xmlsoap.org/soap/encod...
| > >
| > <SOAP-ENV:Body>
| > <xe1:standard SOAP-
| >ENV:encodingStyle="http://schemas.xmlsoap.org/so...
| g
| >/" >
| > <xe1:key xsi:type="xe:messagekey">
| > <partnerkey
| >xsi:type="xsd:string">someguy</partnerkey>
| > <companykey
| >xsi:type="xsd:string">blah,blah</companykey>
| > </xe1:key>
| > </xe1:standard>
| > </SOAP-ENV:Body>
| ></SOAP-ENV:Envelope>
| >
| >the response should look like this.
| ><SOAP-ENV:Envelope
| > xmlns:SOAP-
| >ENV="http://schemas.xmlsoap.org/soap/envel...
| > xmlns:xsi="http://www.w3.org/1999/XMLSchema-inst...
| > xmlns:xsd="http://www.w3.org/1999/XMLSc...
| > >
| > <SOAP-ENV:Body>
| > <ns1:standardResponse xmlns:ns1="urn:VerifyStatus"
| > SOAP-
| >ENV:encodingStyle="http://schemas.xmlsoap.org/so...
| g
| >/">
| > <return xmlns:ns2="urn:mine"
| >xsi:type="ns2:messagekey">
| > <partnerkey xsi:type="xsd:string">PARTNER
| >KEY</partnerkey>
| > <companykey xsi:type="xsd:string">COMPANY
| >KEY</companykey>
| > <timestamp xsi:type="xsd:date">YYYY-MM-DD
| >HH24:MI:SS </timestamp>
| > </return>
| > </ns1:standardResponse>
| > </SOAP-ENV:Body>
| ></SOAP-ENV:Envelope>
| >
| >
| >I cant get the response nor does the method see the
| >message object being passed in.
| >
| >Does any one have any ideas. I dont want to hack teh XML
| >stream going out.
| >
| >Thanks
| >Dan
| >
| >.
| >
|