axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yunxi Zhang <zhangyx...@hotmail.com>
Subject RE: wsdl2java eclipse plugin error
Date Thu, 11 Aug 2011 13:08:28 GMT

Hi, Harshana,

Thank you for your help and the suggestion of the wsdl validator, which is a very useful tool.


I've found you added three attributes in the <definitions> block:
targetNamespace="http://example.com/RespondAction.wsdl"
          xmlns:tns="http://example.com/RespondAction.wsdl"
          xmlns:xsd1="http://example.com/RespondAction.xsd"

I've also checked the wsdl standard saying the attribute targetNamespace is not the required
attribute, but not sure the other two attributes here. Since you added them, is it necessary
to add them in the wsdl file?

I'm a research student, and currently, I've been trying to implement the notion of "Trust
Negotiation" into Web Services. It starts by a Web Service requestor who intends to access
the resource in a Web Service provider. By using this approach, two Web Services can establish
their trust relationship by exchanging their policies, credentials in multiple steps to inform
the other party what kind of credentials are needed or if the credentials can fulfil the policies.
Since there could be more than one policy and credential transferred between two Web Services,
this is the concept "mutliple steps" i meant earlier.  But I'm not sure if the current Axis2
framework is strong enough to implement such a notion. Hope i have elaborated this concept
in a clear way. If it is not clear, i can explain in more detail.

By the way, could you introduce me some good articles about how to edit the java files generated
from the wsdl2java plugins in detail, since I've found the wsdl2java function can generate
both the client service and server service java codes automatically, but I've no idea how
to edit these java files and deploy them as services, cos before I always used the POJO approach
to design my Web Services.

Best wish and regards,

Yunxi




From: harshana05@gmail.com
Date: Thu, 11 Aug 2011 00:20:04 +0530
Subject: Re: wsdl2java eclipse plugin error
To: java-dev@axis.apache.org

Hi Yunxi,
Sorry for the delay. Please find the comments inline.

2011/8/8 Yunxi Zhang <zhangyx395@hotmail.com>









Hi, Harshana,
I've just designed my own wsdl file shown as below:
<?xml version="1.0"?>




<definitions name="RespondingAction" 




	xmlns="http://schemas.xmlsoap.org/wsdl/" 




	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">




    
    <types>
    	<schema xmlns="http://www.w3.org/2001/XMLSchema">




    		<element name="RequestingAction" type="string"/>




    		<element name="RespondingAction" type="string"/>




    	</schema>




    </types>
	
	<message name="ReceiveRequestingActionInput">




		<part name="body" element="RequestingAction"/>




	</message>






	<message name="SendRespondingActionOutput">




		<part name="body" element="RespondingAction"/>




	</message>




	
	<message name="SendRespondingActionFaultOutput">




		<part name="body" element="RespondingAction"/>




		<part name="RespondingAction" element="Fault"/>




	</message>




	
	<portType name="RespondingActionPortType">




		<operation name="SendResultFromRespondingAction">




			<input message="ReceiveRequestingActionInput"/>




			<outpt message="SendRespondingActionOutput"/>




			<fault message="SendRespondingActionFaultOutput"/>




		</operation>




	</portType>	




	
	<binding name="RespondingActionSoapBinding" type="RespondingActionPortType">




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




		<operation name="SendResultFromRespondingAction">




			<soap:operation soapAction="http://localhost:8080/axis2/services/PortalB_RespondingAction"/>




				<input>




					<soap:body use="literal"/>




				</input>




				<output>




					<soap:body use="literal"/>




				</output>




				<fault>




					<soap:fault use="literal"/>




				</fault>




		</operation>




	</binding>






	<service name="RespondingActionService">




		<documentation>return a result about if TN can be used to establish trust relationship</documentation>




		<port name="RespondingActionPort" binding="RespondingActionSoapBinding">




			<soap:address location="http://localhost:8080/axis2/services/PortalB_RespondingAction"/>




		</port>




	</service>






</definitions>





but when i tried to use wsdl2java tool to convert it to java files, got the warning shown
below:
I've no idea about why it said my wsdl was not valid. Could you help me check my wsdl file
again?




I have modified your new WSDL and attached the modified version. Please have a look at it.


You can use Eclipse WSDL validator to validate your WSDL file while you are modifying it.

To use the WSDL validator, right click on the WSDL file and Select "Validate". If your WSDL
file has any issues, then the WSDL validator will indicate that on your WSDL file using the
error marker.





By the way, i'm a little bit confused by the meaning of two attributes: 




the first one is the attribute 'soapAction' in  the <operation> block inside the <binding>
block.
The soapAction attribute specifies tge value of the SOAPAction header for a given operation.
This value is used directly in the SOAPAction header without any modification. 





the second none is the attribute  'location' in the <address> block embedded in the
<service> block.
location attribute is used to give a port an address(a URI). This URI for the location attribute
should comply with the transport specified in the soap:binding. 






I've checked the e
 xamples, but couldn't find out what they are.
Another question is: is it possible to design two Web Services to let them communicate in
multiple steps automatically? Since all the examples in the Axis2 web site is about how to
build a service, and the client send a AXIOMElement message manually.


Can you elaborate more on what you mean by "multiple steps" here?
Thanks and Regards,Harshana 




Many thanks.
Yunxi

From: harshana05@gmail.com
Date: Mon, 8 Aug 2011 18:18:22 +0530




Subject: Re: wsdl2java eclipse plugin error
To: java-dev@axis.apache.org

Hi Yunxi,

2011/8/8 Yunxi Zhang <zhangyx395@hotmail.com>











Hi, Harshana,
Thank you. The wsdl file you provided me is working now. 
Great! Glad to hear :) 






Can I ask you a simple question? Since you mentioned the version of xml schema was old, does
that mean only the latest version of the schema is supported in wsdl2java?






I'm not entirely sure of that. But i tried several times with old schema and all of them failed.
So I believe it does not work. 
Thanks and Regards,


Harshana Martin 
Best regards,
Yunxi



From: harshana05@gmail.com
Date: Mon, 8 Aug 2011 08:59:42 +0530
Subject: Re: wsdl2java eclipse plugin error
To: java-dev@axis.apache.org







Hi Yunxi,
I went through the wsdl you have provided me (http://www.w3.org/TR/wsdl#_wsdl). There I found
several issues as listed below.








1. Port defined for the "StockQuotePort" in the "StockQuoteService" has an incorrect binding
 as tns:StockQuoteBinding.    The correct binding is "tns:StockQuoteSoapBinding".








2. WSDl file refers to the older version of xml schema as xmlns="http://www.w3.org/2000/10/XMLSchema"







    Latest version of the schema is  xmlns="http://www.w3.org/2001/XMLSchema".           
         


Here I have attached the correct version of the WSDL file for the same example. Please use
this wsdl file for your code generation.
Thanks and Regards,
Harshana Martin










On 8 August 2011 08:29, Harshana Eranga Martin <harshana05@gmail.com> wrote:








Hi Yunxi,
Thanks a lot for the detailed explanation. I'll look in to it and get back to you.


Thanks and Regards,Harshana
2011/8/8 Yunxi Zhang <zhangyx395@hotmail.com>














Hi, Harshana,
Thank you for your reply. The wsdl sample file i used is the different one from yours, which
i got from http://www.w3.org/TR/wsdl shown below:








<?xml version="1.0"?>









<definitions name="StockQuote"











targetNamespace="http://example.com/stockquote.wsdl"









          xmlns:tns="http://example.com/stockquote.wsdl"









          xmlns:xsd1="http://example.com/stockquote.xsd"









          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"









          xmlns="http://schemas.xmlsoap.org/wsdl/">











    <types>
       <schema targetNamespace="http://example.com/stockquote.xsd"









              xmlns="http://www.w3.org/2000/10/XMLSchema">









           <element name="TradePriceRequest">









              <complexType>
                  <all>
                      <element name="tickerSymbol" type="string"/>









                  </all>
              </complexType>
           </element>
           <element name="TradePrice">









              <complexType>
                  <all>
                      <element name="price" type="float"/>









                  </all>
              </complexType>
           </element>
       </schema>
    </types>


    <message name="GetLastTradePriceInput">









        <part name="body" element="xsd1:TradePriceRequest"/>









    </message>


    <message name="GetLastTradePriceOutput">









        <part name="body" element="xsd1:TradePrice"/>









    </message>


    <portType name="StockQuotePortType">









        <operation name="GetLastTradePrice">









           <input message="tns:GetLastTradePriceInput"/>









           <output message="tns:GetLastTradePriceOutput"/>









        </operation>
    </portType>


    <binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">









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









        <operation name="GetLastTradePrice">









           <soap:operation soapAction="http://example.com/GetLastTradePrice"/>









           <input>
               <soap:body use="literal"/>









           </input>
           <output>
               <soap:body use="literal"/>









           </output>
        </operation>
    </binding>


    <service name="StockQuoteService">









        <documentation>My first service</documentation>









        <port name="StockQuotePort" binding="tns:StockQuoteBinding">









           <soap:address location="http://example.com/stockquote"/>









        </port>
    </service>


</definitions>



But, I'm not sure if different wsdl files can make the result different. The plugin I used
just popped up a warning window in the last step shown in figure below:












After I clicked on the finish button, a warning window just popped up with errors



Sorry, I have no idea how to print out the stack trace for this error message. Could you tell
me how to do that?









By the way, the IDE i used is myEclipse 8.6, the version of axis2.jar is 1.6.0, and the os
is Mac os 10.6.8. 









Hope this information is clear.









Many thanks
Yunxi





From: harshana05@gmail.com
Date: Sun, 7 Aug 2011 22:44:15 +0530



Subject: Re: wsdl2java eclipse plugin error
To: java-dev@axis.apache.org

Hi Yunxi,
On 7 August 2011 20:00, Yunxi Zhang <zhangyx395@hotmail.com> wrote:














Hi, guys,



I'm using the wsdl2java eclipse plugin to generate a java file from a wsdl file which is sample
wsdl file from w3c web site . 
I believe you are referring to http://www.w3schools.com/webservices/tempconvert.asmx?wsdl.
I used this and was able generate both skeleton and client without any issue.














But i got an error in the last step where popped up a window giving the information "An error
occurred while completing process -java.lang.InterruptedException".














You might have got the error message after the above text in the message box. Can you let
us know the complete error message and the stack trace on your console?
Thanks and Regards,














Harshana Martin
 I've search this error information on line, but found out other users got the different error
information like mine. Has anyone got any idea about this? Thank you.

















Best regards,



Yunxi

---------------------------------------------------------------------

To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org

For additional commands, e-mail: java-dev-help@axis.apache.org






--
Harshana Eranga Martin
Software Engineer,WSO2 Inc.Web: http://wso2.com 













           http://wso2.org
ECF Committer: http://www.eclipse.org/ecf/














Blog: http://harshana05.blogspot.com
Profile: https://www.google.com/profiles/harshana05















 		 	   		  


-- 
Thanks and Regards,
Harshana Martin
--
Harshana Eranga Martin


Software Engineer,WSO2 Inc.
Web: http://wso2.com            http://wso2.org









ECF Committer: http://www.eclipse.org/ecf/
Blog: http://harshana05.blogspot.com









Profile: https://www.google.com/profiles/harshana05



--
Harshana Eranga Martin
Software Engineer,WSO2 Inc.Web: http://wso2.com 







           http://wso2.org
ECF Committer: http://www.eclipse.org/ecf/








Blog: http://harshana05.blogspot.com
Profile: https://www.google.com/profiles/harshana05











---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org 		 	   		  


--
Harshana Eranga Martin
Software Engineer,WSO2 Inc.Web: http://wso2.com 





           http://wso2.org
ECF Committer: http://www.eclipse.org/ecf/






Blog: http://harshana05.blogspot.com
Profile: https://www.google.com/profiles/harshana05






 		 	   		  


-- 
Thanks and Regards,
Harshana Martin
--
Harshana Eranga Martin
Software Engineer,WSO2 Inc.



Web: http://wso2.com            http://wso2.org




ECF Committer: http://www.eclipse.org/ecf/
Blog: http://harshana05.blogspot.com




Profile: https://www.google.com/profiles/harshana05




---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org 		 	   		  
Mime
View raw message