NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

WS service from WSDL

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
cholou



Joined: 19 Feb 2009
Posts: 7

PostPosted: Fri Feb 27, 2009 12:29 pm    Post subject: WS service from WSDL Reply with quote

I tried to create a WS from a WSDL File and I got this error message at the dialog window:

"There is no service in specified WSDL File"

I don't know WHY it appears, because some days ago it run, but I've changed something in the WSDL (the file also was wrong, but was another mistake) and now Netbeans doesn't recognize it :S

this is the file:

Quote:
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:typens="urn:prueba1" name="prueba1" targetNamespace="urn:prueba1">
<wsdl:types>
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:prueba1">
<xsd:element name="jornada" type="typens:jornada"/>
<xsd:complexType name="jornada">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="1" name="partido" type="typens:partido"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="partido">
<xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="doGetidResponse">
<wsdl:part name="id" type="xsd:token"/>
</wsdl:message>
<wsdl:message name="doSetid">
<wsdl:part name="id" type="xsd:token"/>
</wsdl:message>
<wsdl:message name="doGetligaResponse">
<wsdl:part name="liga" type="xsd:token"/>
</wsdl:message>
<wsdl:message name="doSetliga">
<wsdl:part name="liga" type="xsd:token"/>
</wsdl:message>
<wsdl:message name="doGetnumResponse">
<wsdl:part name="num" type="xsd:int"/>
</wsdl:message>
<wsdl:message name="doSetnum">
<wsdl:part name="num" type="xsd:int"/>
</wsdl:message>
<wsdl:message name="doGetequipoLocalResponse">
<wsdl:part name="equipoLocal" type="xsd:token"/>
</wsdl:message>
<wsdl:message name="doSetequipoLocal">
<wsdl:part name="equipoLocal" type="xsd:token"/>
</wsdl:message>
<wsdl:message name="doGetequipoVisitanteResponse">
<wsdl:part name="equipoVisitante" type="xsd:token"/>
</wsdl:message>
<wsdl:message name="doSetequipoVisitante">
<wsdl:part name="equipoVisitante" type="xsd:token"/>
</wsdl:message>
<wsdl:message name="doGetmarcadorResponse">
<wsdl:part name="marcador" type="xsd:token"/>
</wsdl:message>
<wsdl:message name="doSetmarcador">
<wsdl:part name="marcador" type="xsd:token"/>
</wsdl:message>
<wsdl:portType name="FutbolPort">
<wsdl:operation name="doGetid">
<wsdl:output message="typens:doGetidResponse"/>
</wsdl:operation>
<wsdl:operation name="doSetid">
<wsdl:input message="typens:doSetid"/>
</wsdl:operation>
<wsdl:operation name="doGetliga">
<wsdl:output message="typens:doGetligaResponse"/>
</wsdl:operation>
<wsdl:operation name="doSetliga">
<wsdl:input message="typens:doSetliga"/>
</wsdl:operation>
<wsdl:operation name="doGetnum">
<wsdl:output message="typens:doGetnumResponse"/>
</wsdl:operation>
<wsdl:operation name="doSetnum">
<wsdl:input message="typens:doSetnum"/>
</wsdl:operation>
<wsdl:operation name="doGetequipoLocal">
<wsdl:output message="typens:doGetequipoLocalResponse"/>
</wsdl:operation>
<wsdl:operation name="doSetequipoLocal">
<wsdl:input message="typens:doSetequipoLocal"/>
</wsdl:operation>
<wsdl:operation name="doGetequipoVisitante">
<wsdl:output message="typens:doGetequipoVisitanteResponse"/>
</wsdl:operation>
<wsdl:operation name="doSetequipoVisitante">
<wsdl:input message="typens:doSetequipoVisitante"/>
</wsdl:operation>
<wsdl:operation name="doGetmarcador">
<wsdl:output message="typens:doGetmarcadorResponse"/>
</wsdl:operation>
<wsdl:operation name="doSetmarcador">
<wsdl:input message="typens:doSetmarcador"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="FutbolBinding" type="typens:FutbolPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/org/http"/>
<wsdl:operation name="doGetid">
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="doSetid">
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="doGetliga">
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="doSetliga">
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="doGetnum">
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="doSetnum">
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="doGetequipoLocal">
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="doSetequipoLocal">
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="doGetequipoVisitante">
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="doSetequipoVisitante">
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
<wsdl:operation name="doGetmarcador">
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="doSetmarcador">
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="FutbolService">
<wsdl:port name="FutbolPort" binding="typens:FutbolBinding">
<soap:address location="http://localhost:8080/WebApplication3/NewWebServiceService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>


anybody can help me? thank you very much
Back to top
alex.brooker



Joined: 18 Feb 2009
Posts: 13
Location: Dorset, UK

PostPosted: Sat Feb 28, 2009 4:37 pm    Post subject: fix the transport in the binding first, then try and generate service from WSDL Reply with quote

Simply by trying to validate the wsdl in NB 6.5 the transport has an error:

http://schemas.xmlsoap.org/org/http

should be http://schemas.xmlsoap.org/soap/http

so the line looks like this:

<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

You have more errors in the wsdl as an Axis2 service from WSDL generation fails and errors are shown in the log. I will try and fix and then post back,

regards,

Alex[/quote]
Back to top
alex.brooker



Joined: 18 Feb 2009
Posts: 13
Location: Dorset, UK

PostPosted: Sat Feb 28, 2009 5:41 pm    Post subject: next problem and a fixed wsdl Reply with quote

Hi,

some of the operations are rejected because they are 'notifications' that are one-way from the service back to the client, like on old c: int getId(){return 42;} You can have one-way from client to service or request response between the client and service.

According to the wsdl spec at http://www.w3.org/TR/wsdl we have the following quote: "Although the base WSDL structure supports bindings for these four transmission primitives, WSDL only defines bindings for the One-way and Request-response primitives. It is expected that specifications that define the protocols for Solicit-response or Notification would also include WSDL binding extensions that allow use of these primitives."

So notification is an extension, and hence not suprising that the tool doesn't support it. So you need to edit your operations in the following way: (I am not aware of an extension, another poster may be able to add this)

Finish creating your schema types in the wsdl:types section and then reference every operation to use them.

For example:
<wsdl:types>
<xsd:schema xmlns:ns="urn:prueba1" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="urn:prueba1">
<xsd:element name="id">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="id" nillable="true" type="xsd:token"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>

<wsdl:message name="doGetidResponse">
<wsdl:part name="parameters" element="typens:id"/>
</wsdl:message>
<wsdl:message name="doGetidRequest">
<wsdl:part name="parameters" element="typens:id"/>
</wsdl:message>

<wsdl:portType name="FutbolPort">
<wsdl:operation name="doGetid">
<wsdl:input message="typens:doGetidRequest" wsaw:Action="urn:doGetidRequest"/>
<wsdl:output message="typens:doGetidResponse" wsaw:Action="urn:doGetidResponse"/>
</wsdl:operation>
</wsdl:portType>

I suggest that you try and get the thing working with one single operation first, then add in your other operations a few at a time until they all work. Here is the stripped down wsdl I used from your example and this works for a "Service from WSDL" NB 6.5 for a Web Service using the metro stack:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:typens="urn:prueba1"
name="prueba1"
targetNamespace="urn:prueba1">
<wsdl:types>
<xsd:schema xmlns:ns="urn:prueba1" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="urn:prueba1">
<xsd:element name="id">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" name="id" nillable="true" type="xsd:token"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>

<wsdl:message name="doGetidResponse">
<wsdl:part name="parameters" element="typens:id"/>
</wsdl:message>
<wsdl:message name="doGetidRequest">
<wsdl:part name="parameters" element="typens:id"/>
</wsdl:message>

<wsdl:portType name="FutbolPort">
<wsdl:operation name="doGetid">
<wsdl:input message="typens:doGetidRequest" wsaw:Action="urn:doGetidRequest"/>
<wsdl:output message="typens:doGetidResponse" wsaw:Action="urn:doGetidResponse"/>
</wsdl:operation>
</wsdl:portType>

<wsdl:binding name="FutbolBinding" type="typens:FutbolPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="doGetid">
<soap:operation soapAction="urn:doGetid" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:service name="FutbolService">
<wsdl:port name="FutbolPort" binding="typens:FutbolBinding">
<soap:address location="http://localhost:8080/WebApplication3/NewWebServiceService"/>
</wsdl:port>
</wsdl:service>

</wsdl:definitions>

hope that helps Smile

good luck,

Alex
Back to top
cholou



Joined: 19 Feb 2009
Posts: 7

PostPosted: Tue Mar 03, 2009 11:12 am    Post subject: Reply with quote

thank you very much!!!
it's very helpful!
I must do it automatically because I'm developing a Java aplication that implements wsdl and the WSDL:TYPES are generated automatically too from Relaxer, then I can't change anything from the XSD.
thanks a lot!!
Back to top
cholou



Joined: 19 Feb 2009
Posts: 7

PostPosted: Tue Mar 03, 2009 7:23 pm    Post subject: Reply with quote

i got it!
thank you very much, the mistake was at the Binding, the style was "document" and that's not valid, i've changed it to "rpc". thank you very much again Wink
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo