You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Tim Perrett <he...@timperrett.com> on 2008/04/21 00:10:46 UTC

How to use wsdl2js output?

Hey chaps,

Just having a play around with the wsdl2js stuff in 2.1 snapshot. I've  
generated a tester service based on http://webservices.daelab.net/temperatureconversions/TemperatureConversions.wso?WSDL 
  but Im not sure how to use that outputed JS file?

All the prototype classes are in there, but I cant see which one I  
would need to call? Has anyone got any advice?

Cheers

Tim

Re: How to use wsdl2js output?

Posted by Benson Margulies <bi...@gmail.com>.
I'm the perp, and I'm on vacation.

See where you get with the samples and the Confluence doc for now, please.

Re: How to use wsdl2js output?

Posted by Daniel Kulp <dk...@apache.org>.
Benson,

On Wednesday 23 April 2008, Benson Margulies wrote:
> As for the message type, hey, I just made the Javascript client do
> just what the Java client does, didn't I? I would be happy to add a
> way to change it, but I'd like the business to be comparable to what
> the standard-conforming clients do. Dan, can you shed me any light on
> this?

Depends on the SOAP version.   If it's soap 1.1, it should be text/xml.  
If it's 1.2, it should be application/soap-xml.    Thus, this DOES look 
like a bug in the utils thing.


-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: How to use wsdl2js output?

Posted by Tim Perrett <he...@timperrett.com>.
Hey Benson,

> Each of these deserves a JIRA.

Is this something I need to action?

> As for the message type, hey, I just made the Javascript client do  
> just what
> the Java client does, didn't I? I would be happy to add a way to  
> change it,
> but I'd like the business to be comparable to what the standard- 
> conforming
> clients do. Dan, can you shed me any light on this?

Interesting - that might just be a specific problem with that SOAP  
service. I confess I have no tried it (the js client) with another  
endpoint yet so that might be case specific. Never the less having a  
method to change the messaging type would be very handy.

Cheers

Tim


Re: How to use wsdl2js output?

Posted by Benson Margulies <bi...@gmail.com>.
Tim,

Each of these deserves a JIRA.

On the URL, I have to confess that I've always thought that URLs in WSDLs
were stupid. In every client application I've ever written, I've overridden
them with a URL known some other way. However, I recognize that this is
pissing into the wind of all the standards, and I'll be happy to fix it.

As for the message type, hey, I just made the Javascript client do just what
the Java client does, didn't I? I would be happy to add a way to change it,
but I'd like the business to be comparable to what the standard-conforming
clients do. Dan, can you shed me any light on this?

--benson

Re: How to use wsdl2js output?

Posted by Tim Perrett <he...@timperrett.com>.
Hey Dan,

Thanks for your useful input. It seems that the end point had not been  
populated by wsdl2js:

this.url = null;

Obviously thats wrong, so i altered that to be the service endpoint.  
But then I started getting "Error: 415" reported back to it? Thats  
HTTP code for unsupported media type, so did some digging around int  
he cxf-util.js file and found that it was sending messages as content- 
type 'application/xml'; which makes a lot of service end points bomb,  
so I changed it to be 'text/xml'.

Im not overly happy about needing to change the supplied cxf-util  
file, is there not some method of setting the message content type at  
on the instance of CxfApacheOrgUtil()?

Cheers, Tim


Re: How to use wsdl2js output?

Posted by Benson Margulies <bi...@gmail.com>.
The error callback parameter should at least be an explanatory message.
Dan's recipe is the place to start.

Not to mention using venkman and looking at it in detail.

Re: How to use wsdl2js output?

Posted by Daniel Kulp <dk...@apache.org>.
Hmm....   is there any useful information being sent into the demoFailure 
callback?   I think its supposed to get an errror as a parameter.   
Something like:
function demoFailure(error)
{
      alert('error ' + error);
}

Barring that, I would check two things:

1) check the server logs (if you have access) for any faults or other 
stack traces.

2) use wireshark or other TCP trace utility to see the raw transfers to 
see if the returning soap message looks correct.

Dan




On Tuesday 22 April 2008, Tim Perrett wrote:
> Ok, just realized that its all mapped back onto the SoapType object
> through prototype classes.
>
> x = new
> webservices_daelab_net_temperature_TemperatureConversionsSoapType();
> x.FahrenheitToCelcius(demoSucsess, demoFailure, 45);
>
> It appears that the failure callback is being invoked - any ideas how
> I can see what is going on and causing that error?
>
> Cheers
>
> Tim
>
> On 22 Apr 2008, at 09:49, Tim Perrett wrote:
> > Otherwise, the output form wsdl2js, uses CxfApacheOrgClient
> > prototype, which I found in $CXF_HOME/etc/cxf-utils.js - however, so
> > now I get the error:
> >
> > utils has no properties
> > CxfApacheOrgClient(undefined)file:localhost/Us... (line 513)
> > webservices_daelab_net_temperature_CelciusToFahrenheit_op
> > (demoSucsess(), demoFailure(), 36)file:localhost/Us... (line 981)
> > [Break on this error] utils.trace("Client constructor");
> >
> > Any ideas how to get around this?



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: How to use wsdl2js output?

Posted by Tim Perrett <he...@timperrett.com>.
Ok, just realized that its all mapped back onto the SoapType object  
through prototype classes.

x = new  
webservices_daelab_net_temperature_TemperatureConversionsSoapType();
x.FahrenheitToCelcius(demoSucsess, demoFailure, 45);

It appears that the failure callback is being invoked - any ideas how  
I can see what is going on and causing that error?

Cheers

Tim


On 22 Apr 2008, at 09:49, Tim Perrett wrote:

> Otherwise, the output form wsdl2js, uses CxfApacheOrgClient  
> prototype, which I found in $CXF_HOME/etc/cxf-utils.js - however, so  
> now I get the error:
>
> utils has no properties
> CxfApacheOrgClient(undefined)file:localhost/Us... (line 513)
> webservices_daelab_net_temperature_CelciusToFahrenheit_op 
> (demoSucsess(), demoFailure(), 36)file:localhost/Us... (line 981)
> [Break on this error] utils.trace("Client constructor");
>
> Any ideas how to get around this?


Re: How to use wsdl2js output?

Posted by Tim Perrett <he...@timperrett.com>.
Interesting link, thanks Daniel.

Otherwise, the output form wsdl2js, uses CxfApacheOrgClient prototype,  
which I found in $CXF_HOME/etc/cxf-utils.js - however, so now I get  
the error:

utils has no properties
CxfApacheOrgClient(undefined)file:localhost/Us... (line 513)
webservices_daelab_net_temperature_CelciusToFahrenheit_op 
(demoSucsess(), demoFailure(), 36)file:localhost/Us... (line 981)
[Break on this error] utils.trace("Client constructor");

Any ideas how to get around this?

Cheers, Tim


On 21 Apr 2008, at 14:35, Daniel Kulp wrote:

> http://open.iona.com/wiki/display/ProdInfo/FMCS+No.+3+-+Accelerate+Web+Development+on+the+iPhone+-+Roland+Tritsch


Re: How to use wsdl2js output?

Posted by Daniel Kulp <dk...@apache.org>.
One of the IONA folks did a video podcast thing that shows how to use the 
js stuff to access services from an iPhone:

http://open.iona.com/wiki/display/ProdInfo/FMCS+No.+3+-+Accelerate+Web+Development+on+the+iPhone+-+Roland+Tritsch

That might provide another useful starting point.

Dan



On Sunday 20 April 2008, Tim Perrett wrote:
> Hey chaps,
>
> Just having a play around with the wsdl2js stuff in 2.1 snapshot. I've
> generated a tester service based on
> http://webservices.daelab.net/temperatureconversions/TemperatureConver
>sions.wso?WSDL but Im not sure how to use that outputed JS file?
>
> All the prototype classes are in there, but I cant see which one I
> would need to call? Has anyone got any advice?
>
> Cheers
>
> Tim



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: How to use wsdl2js output?

Posted by Glen Mazza <gl...@verizon.net>.
I've never used our wsdl2js functionality, but apparently there are four
js_xxxx samples here[1] that might provides hints for you.

HTH,
Glen

[1]
http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/



2008-04-20 Tim Perrett wrote:
> Hey chaps,
> 
> Just having a play around with the wsdl2js stuff in 2.1 snapshot. I've  
> generated a tester service based on http://webservices.daelab.net/temperatureconversions/TemperatureConversions.wso?WSDL 
>   but Im not sure how to use that outputed JS file?
> 
> All the prototype classes are in there, but I cant see which one I  
> would need to call? Has anyone got any advice?
> 
> Cheers
> 
> Tim