<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated on Wed, 25 Nov 2009 05:19:36 -0800 -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <atom:link href="http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/feed/" rel="self" type="application/rss+xml" />
    <title>Intel Software Network Comments feed</title>
    <link>http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/feed/</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>By Bill Somerville</title>
      <description><![CDATA[ Paul:
    I'm having a problem with AMT and JAX-WS that doesn't appear to be a problem in Axis.  I'd prefer to use JAX-WS, since its footprint is smaller, but both your code and mine fail with the same problem.

    I'm talking to an AMT 5.0.3 machine (Dell Optiplex 960).  An exception is thrown:

javax.xml.ws.soap.SOAPFaultException: Failed to parse the request

(I had to add a SOAP fault handler to get around another JAX-WS problem where the default exception handler assumes that the fault namespace is not null).

This is with the latest JDK (1.6 update 12 and 13).

As I said, this works fine with Axis1, but for some reason, AMT doesn't seem to like the request sent by JAX-WS.

Thoughts?

Thanks... ]]></description>
      <link>http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-28018</link>
      <pubDate>Tue, 21 Jul 2009 08:31:29 -0700</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-28018</guid>
    </item>
    <item>
      <title>By Bill Somerville</title>
      <description><![CDATA[ P.S.  Saw your forum post on this same issue.  Any update from the engineers? ]]></description>
      <link>http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-28019</link>
      <pubDate>Tue, 21 Jul 2009 08:39:56 -0700</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-28019</guid>
    </item>
    <item>
      <title>By paul guermonprez</title>
      <description><![CDATA[ Hello bill,

The problem is coming from the encoding specification in the XML header (not the HTTP header).
some AMT machines (recent firmware) need the utf-8 encoding specification in the XML header.

(the encoding specification i nthe XML header is useless and not mandatory i nSOAP, but needed for some AMT machines ...)

regards, paul ]]></description>
      <link>http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-28487</link>
      <pubDate>Fri, 24 Jul 2009 02:55:29 -0700</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-28487</guid>
    </item>
    <item>
      <title>By Hemant</title>
      <description><![CDATA[ Hi Paul, 
Thanks for the insight in to Java code for Intel AMT. I am trying to get use HardwareAssetInterface to get hardware asset information. Below is what I am trying to (similar to the HelloAMT code provided by you).

HardwareAssetService hardwareAssetService = new HardwareAssetService();
HardwareAssetSoapPortType hwAssetSoapPortType = 
															(HardwareAssetSoapPortType)																hardwareAssetService.getHardwareAssetSoapPort();			
((BindingProvider) hwAssetSoapPortType).getRequestContext().													put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, 																"http://192.168.0.123:16992/HardwareAssetInterface");
Holder<Long> status = new Holder<Long>();
Holder<Long> count = new Holder<Long>();
Holder<AssetDataArrayType> assetData = new Holder<AssetDataArrayType>();
Long assetType = new Long(1);
hwAssetSoapPortType.getAssetData(assetType, status, count, assetData);

But I get the below exception in getAssetData() method:
com.sun.xml.ws.client.ClientTransportException: HTTP Status-Code 404: Not Found - Not Found
	at com.sun.xml.ws.transport.http.client.HttpClientTransport.checkResponseCode(HttpClientTransport.java:219)

I am using Intel Management Engine 5.1.0 Version.
Could please anyone help on the same?

Thanks in anticipation.
Warm regards,
Hemant Malik ]]></description>
      <link>http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-29765</link>
      <pubDate>Tue, 18 Aug 2009 03:06:43 -0700</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-29765</guid>
    </item>
    <item>
      <title>By jagadesan</title>
      <description><![CDATA[ am using axis to get java file from wsdl its working for all the wsdl files in the (Intel amt sdk doc/wsdl)
except the Remote accessAdmininterface.wsdl if i try to get the java file it give only four files 

Any help is needed

thanks in Advanced ]]></description>
      <link>http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-30119</link>
      <pubDate>Tue, 25 Aug 2009 00:26:16 -0700</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-30119</guid>
    </item>
    <item>
      <title>By tgreben</title>
      <description><![CDATA[ Hi Bill,

Here is the way how to make jax-ws to put "encoding" into xml header. 

1. Create a decorator of XMLStreamWriter that enforces "encoding" to be put into xml header:

[code=java]
public class StreamWriter implements XMLStreamWriter {
private final XMLStreamWriter impl;
public StreamWriter(XMLStreamWriter impl) {
	this.impl = impl;
}
public void writeStartDocument() throws XMLStreamException {
	writeStartDocument("1.0");
}
public void writeStartDocument(String encoding, String version)
throws XMLStreamException {
	impl.writeStartDocument(encoding, version);
}
public void writeStartDocument(String version)
throws XMLStreamException {
	writeStartDocument("UTF-8", version);
}
//... (other XMLStreamWriter methods delegating to impl)
}
[/code]

2. Create a decorator of XMLOutputFactory that returns decorated XMLStreamWriter where needed:

[code=java]
public class XMLOutputFactoryWithEncoding extends XMLOutputFactory {
private final XMLOutputFactory impl;
public XMLOutputFactoryWithEncoding(XMLOutputFactory impl) {
	this.impl = (impl == null) ? XMLOutputFactory.newInstance() : impl;
}
public XMLStreamWriter createXMLStreamWriter(OutputStream stream,
String encoding) throws XMLStreamException {
	return new StreamWriter(impl.createXMLStreamWriter(stream, encoding));
}
public XMLStreamWriter createXMLStreamWriter(OutputStream stream)
throws XMLStreamException {
	return new StreamWriter(impl.createXMLStreamWriter(stream));
}
public XMLStreamWriter createXMLStreamWriter(Result result)
throws XMLStreamException {
	return new StreamWriter(impl.createXMLStreamWriter(result));
}
public XMLStreamWriter createXMLStreamWriter(Writer stream)
throws XMLStreamException {
	return new StreamWriter(impl.createXMLStreamWriter(stream));
}
//... (other XMLOutputFactory methods delegating to impl)
}
[/code]

3. Create utility class for modifying default XMLStreamWriterFactory:

[code=java]
public class XMLStreamWriterFactoryModifier {
private static XMLStreamWriterFactory oldFactory = null;

	private XMLStreamWriterFactoryModifier() {
	}
	
	/**
	 * @return <code>true</code> if factory was modified, otherwise <code>false</code>
	 */
	public static synchronized boolean modify() {
		if(oldFactory != null) return false;
				
		// Code below corresponds to static section of XMLStreamWriterFactory
        XMLOutputFactory  xof = null;
        if (Boolean.getBoolean(XMLStreamWriterFactory.class.getName()+".woodstox")) {
            try {
                xof = (XMLOutputFactory)Class.forName("com.ctc.wstx.stax.WstxOutputFactory").newInstance();
            } catch (Exception e) {
                // Ignore and fallback to default XMLOutputFactory
            }
        }
        if (xof == null) {
            xof = XMLOutputFactory.newInstance();
        }

        xof = new XMLOutputFactoryWithEncoding(xof);
        
        XMLStreamWriterFactory f=null;

        // this system property can be used to disable the pooling altogether,
        // in case someone hits an issue with pooling in the production system.
        if(!Boolean.getBoolean(XMLStreamWriterFactory.class.getName()+".noPool")) {
            f = XMLStreamWriterFactory.Zephyr.newInstance(xof);
        }
        if(f==null) {
            // is this Woodstox?
            if(xof.getClass().getName().equals("com.ctc.wstx.stax.WstxOutputFactory")) {
                f = new XMLStreamWriterFactory.NoLock(xof);
            }
        }
        if (f == null) {
            f = new XMLStreamWriterFactory.Default(xof);
        }

		oldFactory = XMLStreamWriterFactory.get();
        XMLStreamWriterFactory.set(f);
        Logger.getLogger(XMLStreamWriterFactory.class.getName()).fine("XMLStreamWriterFactory instance is = "+f);

		return true;
	}
	
	/**
	 * @return <code>true</code> if factory was restored to its previous state, otherwise <code>false</code>
	 */
	public static synchronized boolean rollback() {
		if(oldFactory == null) return false;
		XMLStreamWriterFactory.set(oldFactory);
	    Logger.getLogger(XMLStreamWriterFactory.class.getName()).fine("XMLStreamWriterFactory instance is = "+oldFactory);
		return true;
	}
}
[/code]

4. Put the following line somewhere were application is initialized (e.g. as a first line in main() ):
[code=java]
XMLStreamWriterFactoryModifier.modify();
[/code]

Solution is tested and works on my environment. SOAP requests contain header with [code]encoding="utf-8"[/code] and that makes AMT happy. :-)
I don't have an option to attach source code here, so it is available upon request.

Best regards,
Taras. ]]></description>
      <link>http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-32833</link>
      <pubDate>Fri, 16 Oct 2009 05:47:41 -0700</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/amt-and-java-jax-ws-method/#comment-32833</guid>
    </item>
  </channel></rss>