Quantcast
Channel: Metro and JAXB Related Items on Java.net
Viewing all 171 articles
Browse latest View live

Derivation By Restriction - JAXBElement Types not getting generated when Global Type has nillable = true

$
0
0

Hello There,
We have a situation where in we are using the Derivation by Restriction approach to design our XSD.
Following is the sample which we are having to use this XSD feature.
<---------------PARENT------------------------------->
<complexType name="Parent">
<sequence>
<element ref="NillableElement" minOccurs="0"
maxOccurs="1">
</element>
</sequence>
</complexType>
<---------------Child------------------------------->
<complexType name="Child">
<complexContent>
<restriction base="Parent">
<sequence>
<element ref="NillableElement" minOccurs="1"
maxOccurs="1">
        </element>
                       </sequence>
</restriction>
</complexContent>
</complexType>

<----------Nillable Element Definition------------------>
    <element name="NillableElement" nillable="true">
    <simpleType>
    <restriction base="string">
    <minLength value="1"></minLength>
    <maxLength value="20"></maxLength>
    </restriction>
    </simpleType>
    </element>

We are using JAXB 2.1 to generate the Java Classes using wsimport.
The generated java Class for Parent has the NillableElement as a Type of String but we expect it to be JAXBElement.

We dont want to use generateElementProperty setting at the Global or local level as prescribed in the JAXB Specification.
Is there any other way by which we can achieve it ?


Where can I donwload the lastest jaxb-xercesImpl.jar

$
0
0

I have jaxb-xercesImpl-1.5.jar. I want to updated it but I cannot find it in jaxb project. Please give some suggestions.

Thanks
Alvin

Where can I donwload the lastest jaxb-xercesImpl.jar

$
0
0

I have jaxb-xercesImpl-1.5.jar. I want to updated it but I cannot find it in the jaxb-ri-2.2.7 package. Please give me some suggestions.

Thanks
Alvin

How can I do a WS using JAX-WS than works in an Axis Client?

$
0
0

Hi everybody...

I'm trying to do a simple Hello World Web Service using JAX-WS than can be called by an Axis 1.4 client... I'm working with Netbeans 7.3 and a got this.

package mx.org.ws.publicar; 

import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;

@WebService(serviceName = "HolaMundo")
public class HolaMundo {

@WebMethod(operationName = "hello")
public String hello(@WebParam(name = "name") String txt) {
return "Hello " + txt + " !";
}
}

When I browse the URL for WS (http://localhost:8084/HolaMundo/HolaMundo?wsdl) I got something like this:

<!-- 
Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2-hudson-740-.
-->
<!--
Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2-hudson-740-.
-->
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://publicar.ws.org.mx/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://publicar.ws.org.mx/" name="HolaMundo">
<types>
<xsd:schema>
<xsd:import namespace="http://publicar.ws.org.mx/" schemaLocation="http://localhost:8084/HolaMundo/HolaMundo?xsd=1"/>
</xsd:schema>
</types>
<message name="hello">
<part name="parameters" element="tns:hello"/>
</message>
<message name="helloResponse">
<part name="parameters" element="tns:helloResponse"/>
</message>
<portType name="HolaMundo">
<operation name="hello">
<input wsam:Action="http://publicar.ws.org.mx/HolaMundo/helloRequest" message="tns:hello"/>
<output wsam:Action="http://publicar.ws.org.mx/HolaMundo/helloResponse" message="tns:helloResponse"/>
</operation>
</portType>
<binding name="HolaMundoPortBinding" type="tns:HolaMundo">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="hello">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="HolaMundo">
<port name="HolaMundoPort" binding="tns:HolaMundoPortBinding">
<soap:address location="http://localhost:8084/HolaMundo/HolaMundo"/>
</port>
</service>
</definitions>

A few of customers has Axis 1.4 client's to comsume the Web service... like this.

package clientews; 
 
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
 
public class cliente {
    public cliente() {
    }
   
    public static String consumir(Object[] parametros){
        String regresar = null;
        Service service = null;   
        Call call       = null;
        String endpoint = null;
        try {
          endpoint = "http://localhost:8084/HolaMundo/HolaMundo";         
          service = new Service();
          call = (Call) service.createCall();
          call.setTargetEndpointAddress(new java.net.URL(endpoint));
          call.setOperationName("hello");         
          regresar=String.valueOf(call.invoke(parametros));         
        }// try
        catch (Exception e) {
          e.printStackTrace();
        }// catch
        finally {
          return regresar;
        }// finally
      }
 
    public static void main(String[] args) {
        try {           
            String parametro = "José";
            String respuesta = consumir(new Object[]{parametro});
            System.out.println("respuesta: --->" + respuesta);
        } catch (Exception e) {
            System.err.println(e.toString());
        }
    }
}

However, I try to ran this class I got this error message:

AxisFault 
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
faultSubcode:
faultString: Cannot find dispatch method for {}hello
faultActor:
faultNode:
faultDetail:
   {http://xml.apache.org/axis/}stackTrace:Cannot find dispatch method for {}hello

When I use Axis 1.4 to deploy de same WS I don't have any problem...

package mx.org.ws.publicar; 
 
public class HolaMundo {
    public HolaMundo() {
    }
   
    /**
     * @webmethod
     */
    public String hello(String txt) {
        return "Hello " + txt + " !";
    }
}

When I Bowse the URL for that WS (http://localhost:8988/Pruebas/services/HolaMundo?wsdl) I got this:

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8988/Pruebas/services/HolaMundo" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:intf="http://localhost:8988/Pruebas/services/HolaMundo" targetNamespace="http://localhost:8988/Pruebas/services/HolaMundo"> 
<!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->
<message name="helloRequest">
<part name="txt" type="xsd:string"/>
</message>
<message name="helloResponse">
<part name="helloReturn" type="xsd:string"/>
</message>
<portType name="HolaMundo">
<operation name="hello" parameterOrder="txt">
<input name="helloRequest" message="impl:helloRequest"/>
<output name="helloResponse" message="impl:helloResponse"/>
</operation>
</portType>
<binding name="HolaMundoSoapBinding" type="impl:HolaMundo">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="hello">
<wsdlsoap:operation soapAction=""/>
<input name="helloRequest">
<wsdlsoap:body use="encoded" namespace="http://publicar.ws.org.mx" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output name="helloResponse">
<wsdlsoap:body use="encoded" namespace="http://localhost:8988/Pruebas/services/HolaMundo" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="HolaMundoService">
<port name="HolaMundo" binding="impl:HolaMundoSoapBinding">
<wsdlsoap:address location="http://localhost:8988/Pruebas/services/HolaMundo"/>
</port>
</service>
</definitions>

The same client, with this URL works without problems:

package clientews; 
 
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
 
public class cliente {
    public cliente() {
    }
   
    public static String consumir(Object[] parametros){
        String regresar = null;
        Service service = null;   
        Call call       = null;
        String endpoint = null;
        try {
          endpoint = "http://localhost:8988/Pruebas/services/HolaMundo";         
          service = new Service();
          call = (Call) service.createCall();
          call.setTargetEndpointAddress(new java.net.URL(endpoint));
          call.setOperationName("hello");         
          regresar=String.valueOf(call.invoke(parametros));         
        }// try
        catch (Exception e) {
          e.printStackTrace();
        }// catch
        finally {
          return regresar;
        }// finally
      }
 
    public static void main(String[] args) {
        try {           
            String parametro = "José";
            String respuesta = consumir(new Object[]{parametro});
            System.out.println("respuesta: --->" + respuesta);
        } catch (Exception e) {
            System.err.println(e.toString());
        }
    }
}

The result of ran the class is this:

respuesta: --->Hello José !

So, What is wrong? How can I fix this problem.

Best regards
Leo.

Reliable Messaging Persistence

$
0
0

In metro user guide,I see Chapter 10.4,Table 10.22(url:Your text to link...).Metro can persistence sequence and message storage or not with the label /metro:Persistent.I want to now how to user this function.If I want to store sequence and message in derby.How to do that? Whether I need to config some document to tell glassfish the database's name?Thank you !

[WARNING] unknown extensibility element or attribute "JAXWS" with jaxws-tools 2.2.7 and higher - regression?

$
0
0

I've recently changed my maven project in order to use the latest version of the wsimport tool:

<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>

When I generate the Java artifacts, I have the following warning:
[WARNING] unknown extensibility element or attribute "JAXWS" (in namespace "http://www.w3.org/2000/xmlns/")

Please note that I'm using some jaxws customization files.

If I specify an older version of jaxws-tools in my POM, the warning disappear:

<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.2.6</version>

The problem appears again with the version 2.2.7 and 2.2.8 of jaxws-tools.

Is it a known regression ?

Snapshot of the jaxws customization file:

<jaxws:bindings wsdlLocation="../wsdl/services/system/access/management/SystemAccessManagementPort.wsdl"
                version="2.0"
                xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <jaxws:bindings node="wsdl:definitions/wsdl:portType/wsdl:operation/wsdl:fault[@name='accessDeniedFault']">
        <jaxws:class name="com.oce.wave.sei.api.faults.AccessDeniedFault"/>
    </jaxws:bindings>
</jaxws:bindings>

Using WS-AtomicTransactions from a standalone java client

$
0
0

Is it possible to to control the transaction boundary from a standalone java (7) client when calling a web service in glassfish (4.0) which is implemented to participate in WS-AtomicTransaction.

The webservice is defined as follows;

@WebService
@Stateless
@Transactional(value = Transactional.TransactionFlowType.SUPPORTS,
version = com.sun.xml.ws.api.tx.at.Transactional.Version.WSAT10)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class Bean1 {

@Resource(mappedName = "java:appserver/TransactionManager")
private TransactionManager txManager;
    /**
     * Default constructor.
     */
    public Bean1() {
        // TODO Auto-generated constructor stub
    }
   
    private static String getTxStatus(int status)
    {
    switch(status)
    {
    case Status.STATUS_ACTIVE:
    return "Active";
    case Status.STATUS_COMMITTED:
    return "Committed";
    case Status.STATUS_COMMITTING:
    return "Committing";
    case Status.STATUS_MARKED_ROLLBACK:
    return "Marked for rollback";
    case Status.STATUS_NO_TRANSACTION:
    return "No Transaction";
    case Status.STATUS_PREPARED:
    return "Prepared";
    case Status.STATUS_PREPARING:
    return "Preparing";
    case Status.STATUS_ROLLEDBACK:
    return "Rolledback";
    case Status.STATUS_ROLLING_BACK:
    return "Rollingback";
    case Status.STATUS_UNKNOWN:
    return "Status set to STATUS_UNKNOWN";
    }
    return "Unknown Status " + status;
    }
   
    private String getTxName()
    {
    try {
if(txManager==null)
{
return "No Transaction Manager";
}
else
{
if(txManager.getTransaction() == null)
{
return "No Transaction";
}
else
{
return "A Transaction: status=" + getTxStatus(txManager.getTransaction().getStatus()) + ". {Transaction: " + txManager.getTransaction() +"}";
}
}
} catch (SystemException e) {
return "Error getting TxName: " + e;
}
    }

    @WebMethod
    public String hello(String tag)
    {
    return tag + " you!" + getTxName();
    }
}

The client code uses the wsimport generated client stubs;

Bean1 proxy = new Bean1Service().getBean1Port();
System.out.println(proxy.hello("Hello"));

This works fine as is.
But suppose I wish to control the transaction from the java client in a manner similar to that described in the metro tutorial chap 18; Is there anyway that can work? I am quite happy to use the TransactionManager from the local glassfish to provide the UserTransaction and coordinate, but I would need the transaction to 'flow back in' on the web method and be externally controllable...

import java.rmi.RemoteException;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;

import org.junit.Test;

import uk.co.his.ejbproject1.Bean1;
import uk.co.his.ejbproject1.Bean1Service;

import com.sun.xml.ws.api.tx.at.Transactional.TransactionFlowType;
import com.sun.xml.ws.api.tx.at.Transactional.Version;
import com.sun.xml.ws.api.tx.at.TransactionalFeature;

public class TestClient {

@Test
public void test() throws RemoteException, NamingException,
SecurityException, IllegalStateException, RollbackException,
HeuristicMixedException, HeuristicRollbackException,
SystemException, NotSupportedException {

UserTransaction utx = null;

try {
InitialContext ctx = new InitialContext();
utx = (UserTransaction) ctx.lookup("javax.transaction"
+ ".UserTransaction");
utx.setTransactionTimeout(900);
} catch (java.lang.Exception e) {
e.printStackTrace();
}

TransactionalFeature feature = new TransactionalFeature();
feature.setFlowType(TransactionFlowType.MANDATORY);
feature.setVersion(Version.WSAT10);

Bean1 proxy = new Bean1Service().getBean1Port();

utx.begin();
System.out.println(proxy.hello("Hello"));
utx.commit();
}

}

It would seem this is never possible because the Metro runtimes are looking for a local transaction manager which includes transaction log file directory information.

So when I run with the following container setup...

	@Test
public void test3() throws Exception, UserError
{
TargetServer server = new TargetServer("localhost", 4848);
TargetServer[] servers = { server };
// Get a builder to set up the ACC
AppClientContainer.Builder builder = AppClientContainer.newBuilder(servers);
AppClientContainer acc = builder.newContainer(TestClient.class);
acc.startClient(new String[0]);
}


public static void main(String[] args) throws NotSupportedException, SystemException, SecurityException, IllegalStateException, RollbackException, HeuristicMixedException, HeuristicRollbackException
{
UserTransaction utx = null;
try {
    InitialContext ctx = new InitialContext();
   
    utx = (UserTransaction)ctx.lookup("java:comp/UserTransaction");
        utx.setTransactionTimeout(900);

       

      
    } catch (java.lang.Exception e) {
        e.printStackTrace();
    }
   
TransactionalFeature feature = new TransactionalFeature();
        feature.setFlowType(TransactionFlowType.MANDATORY);
        feature.setVersion(Version.WSAT10);


Bean1 proxy = new Bean1Service().getBean1Port(feature);

        utx.begin();
/*System.out.println(proxy.hello("Hello"));
ComplexData1 data = new ComplexData1();
data.setName("Fred");
data.getChildData().addAll(createComplexData2(10));
printOutComplexData("before", data);
ComplexData1 result = proxy.processData(data, "World!");
data.setName("No longer Fred");
printOutComplexData("after", result);*/
utx.commit();
        System.out.println("Dones");
}

I get the following;
Jul 08, 2013 7:12:23 PM [com.sun.xml.ws.tx.at.common.TransactionImportManager]  <init>
INFO: Missing required extension methods detected on 'javax.transaction.TransactionManager' implementation 'com.sun.enterprise.transaction.TransactionManagerHelper':
getTxLogLocation

Jul 08, 2013 7:12:27 PM [com.sun.xml.ws.tx.at.internal.WSATGatewayRM]  setTxLogDirs
INFO: txlogdir isnull

The com.sun.enterprise.transaction.TransactionManagerHelper is a wrapper around the JNDI lookup for java:appserver/TransactionManager which presumably could be local or remote and might or might not (NOT in the case of a 'standalone' client) have access to the tx logging dirs...
thanks

SOAP, WebParam.Mode.OUT always returns null (solved)

$
0
0

Hi

I have a question to a JAX-WS project using JDK 1.6.0_45

I've generated a webservice from a WSDL looking like this:

...
        <wsdl:operation name="getTransactionList">
            <soap:operation style="document" soapAction="getTransactionList"/>
            <wsdl:input>
                <soap:body use="literal" parts="body"/>
                <soap:header use="literal" message="tns:getTransactionListRequest" part="header"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" parts="body"/>
                <soap:header use="literal" message="tns:getTransactionListResponse" part="header"/>
            </wsdl:output>
            <wsdl:fault name="fault1">
                <soap:fault use="literal" name="fault1"/>
            </wsdl:fault>
        </wsdl:operation>
...
    <wsdl:message name="getTransactionListResponse">
        <wsdl:part name="header" element="ns0:responseHeader"/>
        <wsdl:part name="body" element="ns0:getTransactionListResponse"/>
    </wsdl:message>
...

As you can see, getTransactionList returns a message with 2 components, header and body. Using wsimport this ends up like this:

    @WebMethod(action = "getTransactionList")
    public void getTransactionList(
        @WebParam(name = "requestHeader", targetNamespace = "http://namespace/IAS/WebService/Schema", header = true, partName = "header")
        RequestHeaderType header,
        @WebParam(name = "getTransactionListRequest", targetNamespace = "http://namespace/IAS/WebService/Schema", partName = "body")
        GetTransactionListRequestType body,
        @WebParam(name = "responseHeader", targetNamespace = "http://namespace/IAS/WebService/Schema", header = true, mode = WebParam.Mode.OUT, partName = "header")
        Holder<ResponseHeaderType> header0,
        @WebParam(name = "getTransactionListResponse", targetNamespace = "http://namespace/IAS/WebService/Schema", mode = WebParam.Mode.OUT, partName = "body")
        Holder<GetTransactionListResponseType> body0)
        throws ErrorInfo
    ;

The two return values are annoted as WebParam.Mode.OUT.

Now i've written a short test method

  public static void main(final String[] args) throws Exception {
    try {
      IASService _s = new IASService(new URL("http://127.0.0.1/WodisScratch/IAServiceEndpoint?wsdl"), new QName(
          "http://namespace/IAS/WebService/WDSL/concrete", "IAS_Service"));
      RequestHeaderType header = new RequestHeaderType();
      GetTransactionListRequestType body = new GetTransactionListRequestType();
      Holder<ResponseHeaderType> header0 = new Holder<ResponseHeaderType>(new ResponseHeaderType());
      Holder<GetTransactionListResponseType> body0 = new Holder<GetTransactionListResponseType>(new GetTransactionListResponseType());
      System.out.println("Call");
      System.out.println("body0: " + body0);
      System.out.println("body0.value: " + body0.value);

      System.out.println("*BOOM*");
      _s.getIAServiceEndpoint().getTransactionList(header, body, header0, body0);
      System.out.println("Never seeing this");

      for (Transaction _t : body0.value.getTransaction()) {
        System.out.println(_t.getTransactionId());
      }
    } catch (ErrorInfo e) {
      e.printStackTrace();
    }
  }

Output:

Call
body0: javax.xml.ws.Holder@12d263f
body0.value: namespace.ias.webservice.schema.GetTransactionListResponseType@12a0f6c
*BOOM*

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: java.lang.NullPointerException
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:119)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at com.sun.proxy.$Proxy33.getTransactionList(Unknown Source)
at de.kalo.Test.main(Test.java:31)
Caused by: java.lang.NullPointerException
at namespace.ias.webservice.wdsl.concrete.IAServiceEndpointImpl.getTransactionList(IAServiceEndpointImpl.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:662)

The implementation looks like this:

  public void getTransactionList(final RequestHeaderType header, final GetTransactionListRequestType body, final Holder<ResponseHeaderType> header0,
      final Holder<GetTransactionListResponseType> body0) throws ErrorInfo {
    System.out.println("Start");
    System.out.println("body0: " + body0);
    System.out.println("body0.value: " + body0.value);
   ...

Output:
Start
body0: javax.xml.ws.Holder@1af8502
body0.value: null

Somewhere between API call and implementation the Holder-value ist lost, and replaced by another one with a null-value.

After half a day of googling and trying this and tthat i'm left clueless.

Have you any ideas?

Bye
Holger


Content-Description with extra whitespace

$
0
0

Hello,

When receiving a SOAPMessage with Attachments (signed using XWSS) the receiving server inserts an additional space in front of the Attachment Part Content-Description value which is causing signature validation to fail.

I suspect the following assumption "// SAAJ RI returns trimmed (at start) Content-Description values" might be incorrect.

Client: Content-Description: My Payload file
Server: Content-Description:  My Payload file

I've checked what the server is receiving over the line and it matches the client exactly; something breaks during SOAPMessage creation on the server side.

I've added the following system properties which I suspect could be adding (if not causing) to the problem. However I need 'saaj.mime.optimization:false' in order for my server to accept the message correctly.

System.setProperty("saaj.mime.optimization", "false");
System.setProperty("saaj.lazy.mime.optimization", "false");
System.setProperty("saaj.lazy.contentlength", "true");
System.setProperty("saaj.mime.multipart.ignoremissingendboundary", "true");

Thanks,

Mike

Versions:

Metro: 2.3 (latest April 2013)
Java: 1.6.0_51 Mac OS X

System Properties:

java.runtime.name: Java(TM) SE Runtime Environment
saaj.mime.multipart.ignoremissingendboundary: true
sun.boot.library.path: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries
java.vm.version: 20.51-b01-457
awt.nativeDoubleBuffering: true
gopherProxySet: false
mrj.build: 11M4509
java.vm.vendor: Apple Inc.
java.vendor.url: http://www.apple.com/
path.separator: :
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
file.encoding.pkg: sun.io
sun.java.launcher: SUN_STANDARD
user.country: US
sun.os.patch.level: unknown
java.vm.specification.name: Java Virtual Machine Specification
user.dir: /Users/mike/workspace/
java.runtime.version: 1.6.0_51-b11-457-11M4509
java.awt.graphicsenv: apple.awt.CGraphicsEnvironment
java.endorsed.dirs: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/endorsed
os.arch: x86_64
java.io.tmpdir: /var/folders/mk/gkp6w0qn4l3cnp5mps3kptnw0000gn/T/
line.separator:

java.vm.specification.vendor: Sun Microsystems Inc.
os.name: Mac OS X
sun.jnu.encoding: MacRoman
java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
java.specification.name: Java Platform API Specification
java.class.version: 50.0
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
saaj.lazy.contentlength: true
os.version: 10.8.4
http.nonProxyHosts: local|*.local|169.254/16|*.169.254/16
user.home: /Users/mike
user.timezone:
java.awt.printerjob: apple.awt.CPrinterJob
saaj.mime.optimization: false
file.encoding: MacRoman
java.specification.version: 1.6
java.class.path: /Users/mike/workspace/build:/Users/mike/workspace/izpack/standalone-compiler.jar:/Users/mike/workspace/libs/apache-log4j-extras-1.0.jar:/Users/mike/workspace/libs/bcmail-jdk16-145.jar:/Users/mike/workspace/libs/bcprov-jdk16-145.jar:/Users/mike/workspace/libs/commons-discovery-0.2.jar:/Users/mike/workspace/libs/commons-logging-1.1.jar:/Users/mike/workspace/libs/jackson-core-asl-1.7.4.jar:/Users/mike/workspace/libs/jackson-mapper-asl-1.7.4.jar:/Users/mike/workspace/libs/jcalendar-1.3.3.jar:/Users/mike/workspace/libs/jcommon-1.0.16.jar:/Users/mike/workspace/libs/jep.jar:/Users/mike/workspace/libs/jfreechart-1.0.13.jar:/Users/mike/workspace/libs/jna.jar:/Users/mike/workspace/libs/jython.jar:/Users/mike/workspace/libs/libintl.jar:/Users/mike/workspace/libs/local_policy.jar:/Users/mike/workspace/libs/log4j-1.2.14.jar:/Users/mike/workspace/libs/postgresql-8.4-701.jdbc4.jar:/Users/mike/workspace/libs/postgresql-9.1-902.jdbc4.jar:/Users/mike/workspace/libs/stringtree-json-2.0.5.jar:/Users/mike/workspace/libs/syslog4j-0.9.46-bin.jar:/Users/mike/workspace/libs/US_export_policy.jar:/Users/mike/workspace/libs/webservices-api.jar:/Users/mike/workspace/libs/webservices-extra.jar:/Users/mike/workspace/libs/webservices-rt.jar:/Users/mike/workspace/libs/webservices-extra-api.jar:/Users/mike/workspace/libs/webservices-tools.jar
user.name: mike
java.vm.specification.version: 1.0
sun.java.command: com.flame.core.Messenger
java.home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
sun.arch.data.model: 64
user.language: en
java.specification.vendor: Sun Microsystems Inc.
awt.toolkit: apple.awt.CToolkit
java.vm.info: mixed mode
java.version: 1.6.0_51
java.ext.dirs: /Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext
sun.boot.class.path: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/sunrsasign.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar
java.vendor: Apple Inc.
saaj.lazy.mime.optimization: false
file.separator: /
java.vendor.url.bug: http://bugreport.apple.com/
sun.io.unicode.encoding: UnicodeLittle
sun.cpu.endian: little
mrj.version: 1070.1.6.0_51-457
socksNonProxyHosts: local|*.local|169.254/16|*.169.254/16
ftp.nonProxyHosts: local|*.local|169.254/16|*.169.254/16
sun.cpu.isalist:

enable logging debug leve on metro and dependent library

$
0
0

I deployed metro STS on tomcat, i enabled logging level to FINE at java/jre/lib and tomat/conf logging.properties but still not logging the api with debug statements. Please some one help me.

enable logging debug leve on metro and dependent library

$
0
0

I deployed metro STS on tomcat, i enabled logging level to FINE at java/jre/lib and tomat/conf logging.properties but still not logging the api with debug statements. Please some one help me.

DisableInclusivePrefixList

$
0
0

Hi.

I am successfully running the example from the metro-source-2.2.1-1\samples\ws-security\src\mcs
Then I include the DisableInclusivePrefixList Assertion in the PingService.wsdl and wsit-client.xml
The example still runs successfully, and the PrefixList disappear from the InclusiveNamespaces as expected.

BUT : then I modify the Department data type in the Service_schema.xsd to include an anyType element .
like this :

    <xs:complexType name="department">
        <xs:sequence>
            <xs:element minOccurs="1" maxOccurs="1" name="companyName" nillable="true" type="xs:string"/>
            <xs:element minOccurs="1" maxOccurs="1" name="departmentName" nillable="true" type="xs:string"/>
            <xs:element minOccurs="1" maxOccurs="1" name="document" type="xs:anyType"/>
        </xs:sequence>
    </xs:complexType>

Then i get this error :
WSS1717: Error occurred while doing digest verification of body/payload Please see the server log to find more detail regarding exact cause of the failure.

I am running jdk1.6.0_33 and metro-2.2.1-1 on apache-tomcat-7.0.40

Please,help.

How can I send an array of objects to WS

$
0
0

Hi everybody...

I'm trying to consume a WS in AXIS 1.4 sending an Array of Objects, but always get an empty array in the method than I try to execute...

I have this JavaBean Class:

<br />
package params;<br />
import java.io.Serializable;<br />
public class Person implements Serializable {<br />
  private String name;<br />
  private String lastName;<br />
  public String getName() {<br />
    return name;<br />
  }<br />
  public void setName(String name) {<br />
    this.name = name;<br />
  }<br />
  public String getLastName() {<br />
    return lastName;<br />
  }<br />
  public void setLastName(String lastName) {<br />
    this.lastName = lastName;<br />
  }<br />
  public Person(){<br />
  }<br />
}<br />

I have a Class HelloWorld with a method SayHi than recive an Array of person's, like this:

<br />
package publish;<br />
import params.Person;<br />
public class HelloWorld {<br />
  public HelloWorld(){<br />
  }<br />
  public String[] SayHi(Person[] persons){<br />
    String[] temp = new String[persons.length];<br />
    for (int i = 0; i < persons.length; i++) {<br />
      temp[i] = "Hello" + persons[i].getName() + "" + persons[i].getLastName();<br />
    }<br />
    return temp;<br />
  }<br />
}<br />

My WSDD file looks like this:

<br /><service name="HelloWorld" provider="java:RPC"></p><parameter name="allowedMethods" value="*"/><parameter name="className" value="publish.HelloWorld"/><arrayMapping qname="ns:Persons" xmlns:ns="Persons"<br />
             languageSpecificType="java:params.Person[]"<br />
             encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/><br /></service><br />

And I invoke the WS with this code:

<br />
public static void main(String[] args) {<br />
    try {<br />
      String endpoint = "http://localhost:8084/WSTest/services/HelloWorld";<br />
      Service service = new Service();<br />
      Call call = (Call) service.createCall();<br />
      call.setTargetEndpointAddress( new java.net.URL(endpoint) );<br />
      call.setOperationName("SayHi");<br />
      String[] resultado = null;<br />
      Person[] listOfPersons = new Person[2];<br />
      Person person = new Person();<br />
      person.setName("Leonardo");<br />
      person.setLastName("Córcega");<br />
      listOfPersons[0] = person;<br />
      person = new Person();<br />
      person.setName("Josué");<br />
      person.setLastName("Ufona");<br />
      listOfPersons[1] = person;</p><p>      QName qname = new QName(endpoint, "Persons");<br />
      call.registerTypeMapping(Person[].class, qname, new BeanSerializerFactory(Person[].class, qname), new BeanDeserializerFactory(Person[].class, qname));<br />
      result = (String[]) call.invoke(new Object[]{listOfPersons});<br />
      for (int i = 0; i <= result.length - 1; i++) {<br />
        System.out.println("result " + String.valueOf(i) + ": ".concat(result[i]));<br />
      }<br />
    } catch (Exception e) {<br />
      System.err.println(e.toString());<br />
    }<br />
  }<br />

How I say, when I try to ran this class and consume the WS, I got an empty array in the method SayHi... I can't see where is the problem... but I hope somebody can help to me...

Best Regards
Leo.

List WSDL with asadmin COMMAND

$
0
0

Hi all,

i we are developing as script to monitor all WS in different GLASSFISH domains.
we want to know if there are ways to list all WSDL (Full URL) with asadmin Command.
simulate function ( view WSDL in GLASSFISH web interface.).

Regards,

Med

JAXB Error: "No element mapping exists for......." when binding XML to Objects

$
0
0

I am using STS, jdk 1.7.0_21. I have attached the zipped up STS project and a test file. I generated the classes using jaxb. I also generated the sample xml from the same schema files. When I try to bind the XML to the java objects, I get the following error. Can anyone help please??

On some other thread, it was suggested that I add a binding file. The contents are in the zip file too. But that did not work. I was unable to generate the java classes when I use the binding.

Thanks,

Srini

com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 6 counts of IllegalAnnotationExceptions
No element mapping exists for "http://hix.cms.gov/0.1/hix-ee":"InsuranceApplicant"
this problem is related to the following location:
at @javax.xml.bind.annotation.XmlElementDecl(scope=class javax.xml.bind.annotation.XmlElementDecl$GLOBAL, substitutionHeadName=InsuranceApplicant, defaultValue=, substitutionHeadNamespace=http://hix.cms.gov/0.1/hix-core, namespace=http://applicant-eligibility.ee.ffe.cms.gov/extension/1.0, name=ExchangeAssignedPersonIdentification)
at public javax.xml.bind.JAXBElement gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory.createExchangeAssignedPersonIdentification(gov.niem.niem.niem_core._2.IdentificationType)
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory
No element mapping exists for "http://hix.cms.gov/0.1/hix-core":"PersonIdentification"
this problem is related to the following location:
at @javax.xml.bind.annotation.XmlElementDecl(scope=class javax.xml.bind.annotation.XmlElementDecl$GLOBAL, substitutionHeadName=PersonIdentification, defaultValue=, substitutionHeadNamespace=http://hix.cms.gov/0.1/hix-core, namespace=http://applicant-eligibility.ee.ffe.cms.gov/extension/1.0, name=PartnerAssignedPersonIdentification)
at public javax.xml.bind.JAXBElement gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory.createPartnerAssignedPersonIdentification(gov.niem.niem.niem_core._2.IdentificationType)
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory
No element mapping exists for "http://hix.cms.gov/0.1/hix-core":"PersonIdentification"
this problem is related to the following location:
at @javax.xml.bind.annotation.XmlElementDecl(scope=class javax.xml.bind.annotation.XmlElementDecl$GLOBAL, substitutionHeadName=PersonIdentification, defaultValue=, substitutionHeadNamespace=http://hix.cms.gov/0.1/hix-core, namespace=http://applicant-eligibility.ee.ffe.cms.gov/extension/1.0, name=ExchangeUserIdentification)
at public javax.xml.bind.JAXBElement gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory.createExchangeUserIdentification(gov.niem.niem.niem_core._2.IdentificationType)
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory
There's no ObjectFactory with an @XmlElementDecl for the element {http://hix.cms.gov/0.1/hix-pm}InsurancePlanVariantCategoryCode.
this problem is related to the following location:
at protected java.util.List gov.cms.ffe.ee.applicant_eligibility.extension._1.CSREligibilityType.insurancePlanVariantCategoryCode
at gov.cms.ffe.ee.applicant_eligibility.extension._1.CSREligibilityType
at public gov.cms.ffe.ee.applicant_eligibility.extension._1.CSREligibilityType gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory.createCSREligibilityType()
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory
There's no ObjectFactory with an @XmlElementDecl for the element {http://hix.cms.gov/0.1/hix-ee}InsuranceApplicant.
this problem is related to the following location:
at protected java.util.List gov.cms.hix._0_1.hix_ee.InsuranceApplicationType.insuranceApplicant
at gov.cms.hix._0_1.hix_ee.InsuranceApplicationType
at gov.cms.ffe.ee.applicant_eligibility.extension._1.InsuranceApplicationType
at protected gov.cms.ffe.ee.applicant_eligibility.extension._1.InsuranceApplicationType gov.cms.ffe.ee.applicant_eligibility.extension._1.ApplicantEligibilityResponseType.insuranceApplication
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ApplicantEligibilityResponseType
at protected gov.cms.ffe.ee.applicant_eligibility.extension._1.ApplicantEligibilityResponseType gov.cms.ffe.ee.applicant_eligibility.extension._1.ResponseType.applicantEligibilityResponse
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ResponseType
at public gov.cms.ffe.ee.applicant_eligibility.extension._1.ResponseType gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory.createResponseType()
at gov.cms.ffe.ee.applicant_eligibility.extension._1.ObjectFactory

at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at com.getinsured.parser.UnMarshaller.main(UnMarshaller.java:22)

AttachmentSize
JAXB_Issue.zip300.37 KB

Can I unmarshal into 2 different POJOs??

$
0
0

I need to get REST a response from a web service that will send different XML data depending on the status of the response. For instance, when trying to log in I could get
< loginResponse >
< result > Succeed < /result >
< id > 3874231209809832049328757905-093-2103921-4839324302943 < /id >
< /loginResponse >
or
< loginResponse >
< result > Fail < /result >
< error >
< msg > Bad User ID < /msg >
< code > 9856 < /code >
< /error >
< /loginResponse >

I am presently using this code
JAXBContext jc = JAXBContext.newInstance(LoginResponse.class);
InputStream xml = connection.getInputStream();
LoginResponse response = (LoginResponse)jc.createUnmarshaller().unmarshal(xml);

But this isn't working since I don't know if the login passed or failed. Therefore I don't know which way to cast the unmarshalled file. Is there a way to examine the results before unmarshalling so I can direct which POJO to use? Or is there a better way?

Thanks,
Kevin

Null object on client despite the XML response from WebService

$
0
0

Hello Everybody,

I need your help.
The version used is JAX-WS RI 2.2.6b21 / SOAP 1.2

I am developing a WS client to connect a WebService server made by a vendor.
I am able to send the next XML request :

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
<S:Body>
<ns2:executeAbout xmlns:ns2="http://vendor.com/">
<About/>
</ns2:executeAbout>
</S:Body>
</S:Envelope>

and below the XML response form WebService server :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://vendor.com/">
<soapenv:Body>
<executeAboutResponse xmlns="">
<AboutResponse success="true">
</AboutResponse>
</executeAboutResponse>
</soapenv:Body>
</soapenv:Envelope>

But unfortunatly, the JAVA object response is null and no java exception is raised :


AboutType aboutType = new AboutType();
AboutResponseType aboutResponse = myProxy.executeAbout(aboutType);
assertNotNull(aboutResponse);

What I understood by searching on internet, it's a namespace issue in the reponse.
But where is the issue and how to fix it ?

Thanks a lot for your help, I'm out of idea.

Can't consume .NET web services

$
0
0

Greetings,

I use JAXWS all the time. When I generate and consume my own WS everything works great. I just received my second request to consume WS's defined by an external source. Each time I am unable to parse their WSDL, and each time I am told they generated their WS's with .NET and many clients are using them without a problem.

I am using JAXWS 2.2.8 with Java 1.7.0_25 on a 64 bit Linux box. Any help would be greatly appreciated. Here is the log:

jaxws-ri/bin/wsimport.sh http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL
parsing WSDL...

[WARNING] src-resolve.4.2: Error resolving component 's:schema'. It was detected that 's:schema' is in namespace 'http://www.w3.org/2001/XMLSchema', but components from this namespace are not referenceable from schema document 'http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 's:schema' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL#types?schema1'.
line 13 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL#types?s...

[WARNING] src-resolve: Cannot resolve the name 's:schema' to a(n) 'element declaration' component.
line 13 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL#types?s...

[WARNING] src-resolve: Cannot resolve the name 's1:guid' to a(n) 'type definition' component.
line 5526 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL#types?s...

[ERROR] undefined element declaration 's:schema'
line 13 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL

[ERROR] undefined element declaration 's:schema'
line 6350 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL

[ERROR] undefined element declaration 's:schema'
line 6371 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL

[ERROR] undefined element declaration 's:schema'
line 6829 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL

[ERROR] undefined element declaration 's:schema'
line 6860 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL

[ERROR] undefined element declaration 's:schema'
line 14592 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL

[ERROR] undefined element declaration 's:schema'
line 14606 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL

[ERROR] undefined element declaration 's:schema'
line 14627 of http://www.innovateistore.com/store/ws/americommercedb.asmx?WSDL

Exception in thread "main" com.sun.tools.ws.wscompile.AbortException
at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:144)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2298)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:198)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:141)
at com.sun.tools.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:444)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:205)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:183)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.tools.ws.Invoker.invoke(Invoker.java:174)
at com.sun.tools.ws.WsImport.main(WsImport.java:57)

Choosing between WSIT and Jax-ws

$
0
0

Hello everyone.

My question is quite simple.

In which cases should I prefer use WSIT style (which come with Metro) rather than the standard JAX-WS?

Thanks

JAXBContext in applet doesn't work

$
0
0

Hello,

my problem is to use JAXBContext.newInstance(myClassNyme.class) in my applet. My applet contains only one method. Input parameter is a string (with xml structure).
public String testApplet (final String data) throws JAXBException {
byte[] dataAsByte = data.getBytes();
GenericDataTransformer transformer = new GenericDataTransformer(); // my own class
Map dataMap = transformer.transform(dataAsByte);

ErrorMessage error = new ErrorMessage (); // Is only small class with @Xml annotations
error.setId("errorId:201");
System.out.println(error.getId);
JAXBContext jc = JAXBContext.newInstance(ErrorMessage.class);
System.out.println("context was created");
StringWriter writer = new StringWriter();
jc.createMarshaller().marshal(error, writer);
return writer.getBuffer().toString();
}
}
In java console I get "errorId:201" and that's it. No more messages, no more errors. Only network: cacheentry not found [URL: file:/C:/..../MyApplet.jar, Version: null].
In JUnit tests are all green
.
Html: APPLET CODE="applet.MyApplet.class" NAME="demoApplet"
archive="MyApplet.jar"
style="width: 1px; height: 1px; float: left;">
/APPLET

With ant task I create a jar
"jar destfile="${build.dir}/${generated.jar.file.name}" filesetmanifest="mergewithoutmain" duplicate="preserve">
manifest>
attribute name="Built-By" value="${user.name}"/>
attribute name="Main-Class" value="MyApplet"/>
attribute name="Class-Path" value="."/>
/manifest>
fileset dir="${basedir}/bin/classes" />
zipfileset excludes="META-INF/*.SF" src="lib/jaxb-api-2.2.5.jar"/>
zipfileset excludes="META-INF/*.SF" src="lib/jaxb-impl-2.2.5.jar"/>
zipfileset excludes="META-INF/*.SF" src="lib/generic_data-0.69.jar"/>
/jar>"
And sign it later:
target name="Sign jar files" description="Signs jars">
signjar alias="${keystore.alias}" keystore="${keystore.file}" storetype="${keystore.type}"
storepass="idexpert" sigalg="MD5withRSA" digestalg="SHA1" lazy="true">
fileset dir="${build.dir}">
include name="*.jar" />
/fileset>
/signjar>
ivy:publish settingsref="ref.settings.ivy" artifactspattern="${build.dir}/[artifact]-[revision]-[type].[ext]" resolver="shared" overwrite="true" />
/target

Has anyone any idea? Applet, html and ant tasks are new areas for me. But i have to do that.

Please help !!

I am very thankful for your ideas.

Viewing all 171 articles
Browse latest View live