jax-ws

JAX-WS, Websphere AS 8.5 and XML Digital SIgnature

痴心易碎 提交于 2020-01-05 04:03:08
问题 I'm developing a JAX-WS webservice that must validate incoming SOAP messages according to the XML Digital Signature specification. I'm noticing a strange behaviour, I can validate the very first incoming message but then validation fails on subsequent messages (on both signature and reference). If i restart the Application Server (Websphere 8.5) i can validate the first message. It seems that the Application Server modifies incoming SOAP Messages before i can parse them. The modified SOAP

How can I avoide XSD sequence when generating XSDs from JAX-WS?

孤者浪人 提交于 2020-01-04 14:13:43
问题 When I have annotaded java class like @javax.xml.bind.annotation.XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class UserdataType { String username; String street; String address; it will be generated to <xs:complexType name="userdataType"> <xs:sequence> <xs:element name="username" type="xs:string" minOccurs="0"/> <xs:element name="street" type="xs:string" minOccurs="0"/> <xs:element name="address" type="xs:string" minOccurs="0"/> So, by default JAX-WS always generates

How to return a custom complex type in JAX-WS web services?

泄露秘密 提交于 2020-01-04 06:49:13
问题 I have been attempting recently to write a web service that returns a custom object. This object is very simple: public class AppInfo { private int AppID; private String Appname; private String AppDesc; private String AppPriv; public int GetAppID() { return this.AppID;} public void SetAppID(int AppID) { this.AppID = AppID;} public String GetAppName() { return this.Appname;} public void SetAppName(String AppName) { this.Appname = AppName;} public String GetAppDesc() { return this.AppDesc;}

JAX-WS WebService Client - “Response: '401: Unauthorized' for url”

回眸只為那壹抹淺笑 提交于 2020-01-04 05:19:10
问题 I'm trying to instantiate a Web Service Client in Java, which its url is secured by username and password. When instantiating it, throws a WebServiceException; here is the stacktrace: javax.xml.ws.WebServiceException: java.io.FileNotFoundException: Response: '401: Unauthorized' for url: WSDLURL at com.sun.xml.ws.wsdl.WSDLContext.<init>(WSDLContext.java:68) at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:207) at com.sun.xml.ws.client.WSServiceDelegate.<init>

JAX-WS deployment best practice: WSDL location and client generation

岁酱吖の 提交于 2020-01-04 02:16:27
问题 I followed these steps to create a webservice: Created a service interface & implementation with @WebService and @WebMethod annotations Deployed the service Generated client stubs with wsimport Invoked webservice with a client program that looks like: public static void main(String[] args) throws Exception { URL url = new URL("http://SERVER:PORT/HelloWorldPOC/HelloWorldPOCImplService?wsdl"); QName qname = new QName("http://helloworld.poc.com/", "HelloWorldPOCImplService"); Service service =

JAX-WS RI on Java 5

为君一笑 提交于 2020-01-03 18:34:16
问题 First of all, according to the documentation, the JAX-WS reference implementation is supposed to work with Java 5. The binary package with the latest version (2.2.7) is however compiled with Java 6 (class version 50.0), so using it with Java 5 will cause an UnsupportedClassVersionError to be thrown. I've downloaded the Java sources and tried to compile them with Java 5, but since dependent libraries are compiled for Java 6, this does not work directly either. I've tried to compile a new

How to send additional fields to soap handler along with soapMessage?

杀马特。学长 韩版系。学妹 提交于 2020-01-03 00:39:27
问题 I am logging RequestXML for a webservice client using SoapHandler as follows public boolean handleMessage(SOAPMessageContext smc) { logToSystemOut(smc); return true; } private void logToSystemOut(SOAPMessageContext smc) { Boolean outboundProperty = (Boolean) smc.get (MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (outboundProperty.booleanValue()) { out.println("\nOutbound message:"); } else { out.println("\nInbound message:"); } SOAPMessage message = smc.getMessage(); try { message.writeTo(out

How to send additional fields to soap handler along with soapMessage?

纵饮孤独 提交于 2020-01-03 00:39:10
问题 I am logging RequestXML for a webservice client using SoapHandler as follows public boolean handleMessage(SOAPMessageContext smc) { logToSystemOut(smc); return true; } private void logToSystemOut(SOAPMessageContext smc) { Boolean outboundProperty = (Boolean) smc.get (MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (outboundProperty.booleanValue()) { out.println("\nOutbound message:"); } else { out.println("\nInbound message:"); } SOAPMessage message = smc.getMessage(); try { message.writeTo(out

javax.xml.ws.WebServiceException: Failed to access the WSDL. Response: '401: Unauthorized'

醉酒当歌 提交于 2020-01-02 10:05:51
问题 I am trying to access a web service for a project i'm working on. I'm using JAX-WS and the app is deployed on weblogic. When i'm trying to access the WS, i get the following exception: javax.portlet.PortletException: javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://xxx.xxxx.ro:40000/idm/ws/cup?wsdl. It failed with: Response: '401: Unauthorized' for url: 'http://xxx.xxxx.ro:40000/idm/ws/cup?wsdl'. at com.bea.portlet.container.PortletStub.processAction(PortletStub.java:346

Arrays in SOAP method Parameters generated via JAX-WS?

喜夏-厌秋 提交于 2020-01-02 07:46:10
问题 I am building a SOAP service in Java with JAX-WS annotations. Among other things I wonder how to annotate array parameters in my methods. At the moment when I generate a wsdl from my annotated interface and then generate java classes again from that wsdl (I do that for testing, in both cases using Apache cxf), it will generate Classes to hold the array parameters. Example: @WebService(name="sillyService", ... ) @SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL,