Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Complex soap messages with structures

Reply
Thread Tools

Complex soap messages with structures

 
 
Dan
Guest
Posts: n/a
 
      08-29-2003
Now I am really confused.

here is the stream going in

<SOAP-ENV:Envelope
xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlnssi="http://www.w3.org/1999/XMLSchema-instance"
xmlnssd="http://www.w3.org/1999/XMLSchema"
xmlnse="urn:embrasure"
xmlnse1=" urn:VerifyStatus"
xmlnse2="http://schemas.xmlsoap.org/soap/encoding/"
>

<SOAP-ENV:Body>
<xe1:standard SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding
/" >
<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/envelope/"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xmlnssd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>

<faultstring>System.Web.Services.Protocols.SoapExc eption:
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.XmlS erializat
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.R eadParame
ters()
--- End of inner exception stack trace ---
at
System.Web.Services.Protocols.SoapServerProtocol.R eadParame
ters()
at
System.Web.Services.Protocols.WebServiceHandler.In voke()
at
System.Web.Services.Protocols.WebServiceHandler.Co reProcess
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/Soap" )]
[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/envelope/"
> xmlnssi="http://www.w3.org/1999/XMLSchema-instance"
> xmlnssd="http://www.w3.org/1999/XMLSchema"
> xmlnse="urn:mine"
> xmlnse1=" urn:VerifyStatus"
> xmlnse2="http://schemas.xmlsoap.org/soap/encoding/"
> >

> <SOAP-ENV:Body>
> <xe1:standard SOAP-
>ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin

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/standard",
>
>RequestNamespace="http://172.17.89.26/standard",
>
>ResponseNamespace="http://172.17.89.26/standardResponse",
> 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/envelope/"
> xmlnssi="http://www.w3.org/1999/XMLSchema-instance"
> xmlnssd="http://www.w3.org/1999/XMLSchema"
> xmlnse="urn:mine"
> xmlnse1=" urn:VerifyStatus"
> xmlnse2="http://schemas.xmlsoap.org/soap/encoding/"
> >

> <SOAP-ENV:Body>
> <xe1:standard SOAP-
>ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin

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/envelope/"
> xmlnssi="http://www.w3.org/1999/XMLSchema-instance"
> xmlnssd="http://www.w3.org/1999/XMLSchema"
> >

> <SOAP-ENV:Body>
> <ns1:standardResponse xmlns:ns1="urn:VerifyStatus"
> SOAP-
>ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin

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

 
Reply With Quote
 
 
 
 
Lewis Wang [MSFT]
Guest
Posts: n/a
 
      09-01-2003
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" <(E-Mail Removed)>
| Sender: "Dan" <(E-Mail Removed)>
| References: <0e2d01c36d84$51e9e6e0$(E-Mail Removed)>
| Subject: Complex soap messages with structures
| Date: Fri, 29 Aug 2003 10:03:07 -0700
| Lines: 261
| Message-ID: <019801c36e4f$6afb6d40$(E-Mail Removed)>
| 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.webservic es
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservic es:19100
| NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
|
| Now I am really confused.
|
| here is the stream going in
|
| <SOAP-ENV:Envelope
| xmlns:SOAP-
| ENV="http://schemas.xmlsoap.org/soap/envelope/"
| xmlnssi="http://www.w3.org/1999/XMLSchema-instance"
| xmlnssd="http://www.w3.org/1999/XMLSchema"
| xmlnse="urn:embrasure"
| xmlnse1=" urn:VerifyStatus"
| xmlnse2="http://schemas.xmlsoap.org/soap/encoding/"
| >
| <SOAP-ENV:Body>
| <xe1:standard SOAP-
| ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding
| /" >
| <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/envelope/"
| xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
| xmlnssd="http://www.w3.org/2001/XMLSchema">
| <soap:Body>
| <soap:Fault>
| <faultcode>soap:Client</faultcode>
|
| <faultstring>System.Web.Services.Protocols.SoapExc eption:
| 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.XmlS erializat
| 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.R eadParame
| ters()
| --- End of inner exception stack trace ---
| at
| System.Web.Services.Protocols.SoapServerProtocol.R eadParame
| ters()
| at
| System.Web.Services.Protocols.WebServiceHandler.In voke()
| at
| System.Web.Services.Protocols.WebServiceHandler.Co reProcess
| 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/Soap" )]
| [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/envelope/"
| > xmlnssi="http://www.w3.org/1999/XMLSchema-instance"
| > xmlnssd="http://www.w3.org/1999/XMLSchema"
| > xmlnse="urn:mine"
| > xmlnse1=" urn:VerifyStatus"
| > xmlnse2="http://schemas.xmlsoap.org/soap/encoding/"
| > >
| > <SOAP-ENV:Body>
| > <xe1:standard SOAP-
| >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin
| 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/standard",
| >
| >RequestNamespace="http://172.17.89.26/standard",
| >
| >ResponseNamespace="http://172.17.89.26/standardResponse",
| > 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/envelope/"
| > xmlnssi="http://www.w3.org/1999/XMLSchema-instance"
| > xmlnssd="http://www.w3.org/1999/XMLSchema"
| > xmlnse="urn:mine"
| > xmlnse1=" urn:VerifyStatus"
| > xmlnse2="http://schemas.xmlsoap.org/soap/encoding/"
| > >
| > <SOAP-ENV:Body>
| > <xe1:standard SOAP-
| >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin
| 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/envelope/"
| > xmlnssi="http://www.w3.org/1999/XMLSchema-instance"
| > xmlnssd="http://www.w3.org/1999/XMLSchema"
| > >
| > <SOAP-ENV:Body>
| > <ns1:standardResponse xmlns:ns1="urn:VerifyStatus"
| > SOAP-
| >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin
| 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
| >
| >.
| >
|

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding complex Menu structures Ravi Shankar Nair Java 4 06-28-2006 02:17 PM
structures, structures and more structures (questions about nestedstructures) Alfonso Morra C Programming 11 09-24-2005 07:42 PM
[NEWBIE] HowTo access complex STL-Vector structures... Markus Kern C++ 7 02-22-2005 03:01 PM
Type Casting IPv4 and IPv6 structures to Generic Structures tweak C Programming 14 06-11-2004 02:43 PM
sharing complex data structures between threads in mod_perl2 Dennis Gavrilov Perl 1 07-24-2003 07:22 AM



Advertisments