The moose likes Web Services and the fly likes Cannot find child element: arg0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Cannot find child element: arg0" Watch "Cannot find child element: arg0" New topic
Author

Cannot find child element: arg0

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

hi,
I am trying to run a web service.
The Java client runs without any problem.
But I have tried 2 clients: one in PHP, the other one with VBS, and both give me the error "Cannot find child element: arg0"

Here is the code
Echo.java


EchoBean.java


If i specify the name of the parameter with the @WebParam, then i get the same error message : "Cannot find child element: MyParam".

So i am using the RPC/LITERAL style, and I get the error "Cannot find child element: arg0"
If I use the DOCUMENT/LITERAL style, I get a different error.
Anyways, I am stuck here.
Does anyone have an idea ?
I know it is not PHP related, since I get the exact same error with a completely different client (VBS).

Thanks for helping


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by Celinio Fernandes:
I know it is not PHP related, since I get the exact same error with a completely different client (VBS).


Are you sure that both of them aren't trying to access the web service in rpc/encoded (which isn't supported by JAX-WS), rather than rpc/literal messaging/encoding style? Just a thought.

Use Apache TCPMon (Tutorial) (or java.net tcpmon) to have a look at the HTTP/SOAP requests and responses - that may help to shed some light on what is going on (and what is different).
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

I used TCPMon and here are the messages that i get :


and


and here is my WSDL, generated with JBoss 4.2.2.GA

any idea ? thanks again
[ January 20, 2008: Message edited by: Celinio Fernandes ]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
As I understand it, your echo is expected to send back a copy of the body of the request. But your request does not have a body! It is a simple GET with no parameters and no body.

Bill
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Originally posted by William Brogden:
As I understand it, your echo is expected to send back a copy of the body of the request. But your request does not have a body! It is a simple GET with no parameters and no body.

Bill


Where exactly do you see that, and what do you suggest i should or could do to fix it ?
Thanks
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
I suspect that you have used tcpmon between the browser and the PHP server. You need to use tcpmon between the PHP SOAP consumer and the Java SOAP provider. However I would suggest that you capture the request/response pairs between the working Java SOAP consumer and Java SOAP provider first to give you a baseline for what a valid request/response pair looks like.

Then capture the requests from (and responses, if any, for) the PHP and VBScript SOAP consumers and see how they need to be tweaked. In the worst case you may have to adjust the Java SOAP provider so that your PHP and VBScript consumers can access it (though it would probably be better to offer them an alternate endpoint that uses their protocol conventions).

The request/response pairs should look more like the ones shown in this post.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
Where exactly do you see that


Tcpmon has captured your entire request and response - interpreting the lines we see that:

1. GET /SOAP-DOCUMENT_Echo.php HTTP/1.1
says this is a HTTP GET request - which typically have no body
If a body had been sent, there would be a blank line after the headers, followed by the body text.

2. There is no Content-Length giving the length of a body or any other header related to content.


Follow Peer's suggestion and use TCPMON to look at typical valid SOAP request and response contents.
[ January 21, 2008: Message edited by: William Brogden ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot find child element: arg0