Bpel: problems importing schema from http-url
i have problems importing the schema "http://schemas.xmlsoap.org/ws/2003/03/addressing/". I'm using JDeveloper 10.1.3.3.0.4157 and SoaSuite 10.1.3.1.0 with the patch 10.1.3.3.0.
The problem can be reproduced very easily:
* create a new "BPEL Process Project" from template "Synchronous BPEL Process" and use all default settings
-> deploying to my local app-server works
* add a new variable to the process
* select "Element" as type
* click "Browse Elements..."
* click "Import Schema File..."
* enter "http://schemas.xmlsoap.org/ws/2003/03/addressing/"
* select "Imported Schemas/addressing/EndpointReference"
* finish creating variable
* save all and deploy
-> the ant console shows the following error:
BUILD FAILED
C:\oracle\JDeveloper\jdev\mywork\TejTest\BPELProcess1\build.xml:79: A problem occured while connecting to server "127.0.0.1" using port "8888": bpel_BPELProcess1_1.0.jar failed to deploy. Exception message is: ORABPEL-05215
Fehler beim Laden von Prozess.
Bei der Prozessdomäne sind folgende Fehler beim Laden des Prozesses "BPELProcess1" (Revision "1.0") aufgetreten: BPEL-Validierung nicht erfolgreich.
Validierung der BPEL-Quelle nicht erfolgreich. Fehler:
[Fehler ORABPEL-10902]: Kompilierung nicht erfolgreich
[Beschreibung]: in "bpel.xml", XML-Parsing nicht erfolgreich. Grund "nicht definiertes Teilelement.
In WSDL-Datei bei "file:/C:/oracle/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_BPELProcess1_1.0_c64929dfd2dacf95db3c9da081c1797d.tmp/BPELProcess1.wsdl" ist das Teilelement der Nachricht "{http://xmlns.oracle.com/BPELProcess1}BPELProcess1ProcessRequest" in keinem der Schemas definiert.
Vergewissern Sie sich, dass die Schreibweise des QName-Elements korrekt ist und dass der WSDL-Import vollständig ausgeführt wurde.
[Mögliche Behebung]: n/v.
Wenn Sie ein Patch auf dem Server installiert haben, stellen Sie sicher, dass die bpelcClasspath-Domäneneigenschaft die Patch-Klassen enthält.
at com.collaxa.cube.engine.deployment.CubeProcessHolder.bind(CubeProcessHolder.java:285)
at com.collaxa.cube.engine.deployment.DeploymentManager.deployProcess(DeploymentManager.java:862)
at com.collaxa.cube.engine.deployment.DeploymentManager.deploySuitcase(DeploymentManager.java:728)
at com.collaxa.cube.ejb.impl.BPELDomainManagerBean.deploySuitcase(BPELDomainManagerBean.java:445)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
sorry for the german message, i couldn't get the english version. basically it says that "{http://xmlns.oracle.com/BPELProcess1}BPELProcess1ProcessRequest" is not defined in any schema, what is very strange because before importing the schema from http..., the element ...BPELProcess1ProcessRequest has been found.
another strange thing is that if i download the schema from http://schemas.xmlsoap.org/ws/2003/03/addressing/ and import it from a local file, everything works as expected.
When importing a schema there are two attributes to the import element to be aware of: namespace and schemaLocation. I think this is the basis of confusion, particularly where the same value is used for both in this case.
I suspect that the schema import works for ax90033 because the schemaLocation is being specified as "http://schemas.xmlsoap.org/ws/2003/03/addressing/".
The W3C has some further information on this at http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#element-import which gives an indication of the complexity that lies behind schema imports.
Peter
http://soastation.blogspot.com
Similar Messages
-
Hi,
I am developing a web tool that accesses client's Bingads accounts via OAUTH2 granting. I am downloading data from clients daily.
Generally it worked, but for 2 days I am experiencing a weird issue, that in random times (but more and more often though) I receive random error messages from Bing server. I am pasting below a few example from my logs (with timestamp and request/response).
Must note that I launch these requests from the server where we have the webapp but also I launch it locally. The same is the result.
The timestamp is in France time (GMT+1).
Thanks ahead!
Best regards,
Steve
2015-01-14 15:08:05: Service\BingAds::initService => SOAP-ERROR: Parsing Schema: can't import schema from 'https://reporting.api.bingads.microsoft.com/Api/Advertiser/Reporting/V9/ReportingService.svc?xsd=xsd0'
---------Soap Request:--------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://bingads.microsoft.com/CampaignManagement/v9"><SOAP-ENV:Header><ns1:CustomerAccountId>XXX</ns1:CustomerAccountId><ns1:CustomerId/><ns1:DeveloperToken>XXX</ns1:DeveloperToken><ns1:UserName/><ns1:Password/><ns1:AuthenticationToken>XXX</ns1:AuthenticationToken></SOAP-ENV:Header><SOAP-ENV:Body><ns1:GetDetailedBulkDownloadStatusRequest><ns1:RequestId>108277125</ns1:RequestId></ns1:GetDetailedBulkDownloadStatusRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
---------Response:------------------------------------------------
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:TrackingId xmlns:h="https://bingads.microsoft.com/CampaignManagement/v9">XXXXX</h:TrackingId></s:Header><s:Body><GetDetailedBulkDownloadStatusResponse
xmlns="https://bingads.microsoft.com/CampaignManagement/v9"><Errors i:nil="true" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/><ForwardCompatibilityMap xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/><PercentComplete>100</PercentComplete><RequestStatus>Completed</RequestStatus><ResultFileUrl>https://download.api.bingads.microsoft.com/ReportDownload/Download.aspx?q=XXX</ResultFileUrl></GetDetailedBulkDownloadStatusResponse></s:Body></s:Envelope>
2015-01-15 05:41:39: Service\BingAds::getCampaigns => SoapFault: Could not connect to host
---------Soap Request:--------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://bingads.microsoft.com/CampaignManagement/v9"><SOAP-ENV:Header><ns1:CustomerAccountId>XXX</ns1:CustomerAccountId><ns1:CustomerId/><ns1:DeveloperToken>XXX</ns1:DeveloperToken><ns1:UserName/><ns1:Password/><ns1:AuthenticationToken>XXX</ns1:AuthenticationToken></SOAP-ENV:Header><SOAP-ENV:Body><ns1:GetCampaignsByAccountIdRequest><ns1:AccountId>XXX</ns1:AccountId></ns1:GetCampaignsByAccountIdRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
---------Response:------------------------------------------------
(empty response logged)
2015-01-15 05:45:00: Service\BingAds::initService => SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v9/CampaignManagementService.svc?singleWsdl' : failed to load external entity "https://api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v9/CampaignManagementService.svc?singleWsdl"
2015-01-15 11:58:46: Service\BingAds::getCampaigns =>
---------Soap Fault:--------------------------------------------
SoapFault catched:
Could not connect to host
---------Soap Request:--------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://bingads.microsoft.com/CampaignManagement/v9"><SOAP-ENV:Header><ns1:CustomerAccountId>XXXX</ns1:CustomerAccountId><ns1:CustomerId/><ns1:DeveloperToken>XXXX</ns1:DeveloperToken><ns1:UserName/><ns1:Password/><ns1:AuthenticationToken>XXX</ns1:AuthenticationToken></SOAP-ENV:Header><SOAP-ENV:Body><ns1:GetCampaignsByAccountIdRequest><ns1:AccountId>XXXX</ns1:AccountId></ns1:GetCampaignsByAccountIdRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
---------Response:------------------------------------------------
(empty response logged)
2015-01-15 11:59:50: Service\BingAds::initService =>
---------Soap Fault:--------------------------------------------
SoapFault catched:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v9/CampaignManagementService.svc?singleWsdl' : failed to load external entity "https://api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v9/CampaignManagementService.svc?singleWsdl"
---------Soap Request:--------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://bingads.microsoft.com/CampaignManagement/v9"><SOAP-ENV:Header><ns1:CustomerAccountId>XXX</ns1:CustomerAccountId><ns1:CustomerId/><ns1:DeveloperToken>XXXXX</ns1:DeveloperToken><ns1:UserName/><ns1:Password/><ns1:AuthenticationToken>XXXX</ns1:AuthenticationToken></SOAP-ENV:Header><SOAP-ENV:Body><ns1:GetCampaignsByAccountIdRequest><ns1:AccountId>XXX</ns1:AccountId></ns1:GetCampaignsByAccountIdRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
---------Response:------------------------------------------------
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:TrackingId xmlns:h="https://bingads.microsoft.com/CampaignManagement/v9">XXXXX</h:TrackingId></s:Header><s:Body><GetCampaignsByAccountIdResponse
xmlns="https://bingads.microsoft.com/CampaignManagement/v9"><Campaigns xmlns:i="http://www.w3.org/2001/XMLSchema-instance"></Campaign>........</Campaigns></GetCampaignsByAccountIdResponse></s:Body></s:Envelope>
2015-01-15 12:05:55: Service\BingAds::getCampaigns =>
---------Soap Fault:--------------------------------------------
SoapFault catched:
Could not connect to host
---------Soap Request:--------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://bingads.microsoft.com/CampaignManagement/v9"><SOAP-ENV:Header><ns1:CustomerAccountId>XXXXX</ns1:CustomerAccountId><ns1:CustomerId/><ns1:DeveloperToken>XXXXX</ns1:DeveloperToken><ns1:UserName/><ns1:Password/><ns1:AuthenticationToken>XXXXXX</ns1:AuthenticationToken></SOAP-ENV:Header><SOAP-ENV:Body><ns1:GetCampaignsByAccountIdRequest><ns1:AccountId>XXXXX</ns1:AccountId></ns1:GetCampaignsByAccountIdRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
---------Response:------------------------------------------------
(empty response logged)Hi,
1. I am using the older version of the PHP library provided by Bing (updated on 1/20/2014), so that is doing the WSDL loadings. I initialize the proxy calling OpticoBingAdsClientProxy providing what it needs, and then do the requests.
2. I have a cron that reads data from client's accounts. I make several calls, like get search query report, get keyword performance report, get keyword bulk data. As the script progressed the first 2 worked and the third gave error. Or in other cases the
first request failed. The calls have quite some time in between them since I process data (sometimes even 160 seconds)
3. I did not change the code ion terms of requests, since as I said I use the PHP library (same credentials, ...).
As of today (2015-01-16 10:30 GMT + 2) running my script, still have the same issues.
Thank you!
Steve -
Hello, I just setup my network attached storage and I'm having problems importing music from it. I get a runtime error with CTImport.exe "abnormal program termination", nice and informati've (see below). I'm running MediaSource 3.30.2, the most recent version. I can add songs little by little, but anytime I try and import a bunch, I get the error. It's not the length of the pathname either, because I added the longest one individually, and it was fine.
I tried importing from a mapped dri've letter and from the network path directly, both have same problem. I also get the same error from the file sniffer built into MediaSource.
I'm actually running an external USB hard dri've that is attached to Linksys's Storage Link NLSU2 (or something). Don't know if that is the problem. Any help is appreciated.
Thanks in advance.
<IMG src="http://www.dustinandalison.com/Ebay Pics/MediaSourceError.JPG">Yes, I originally had all my songs on my local dri've. Anyway, it turned out to be a "corrupt" file. This file was fine in every other media player I had, but MediaSource couldn't do anything with it, not even play it (it was an unprotected .wma). I don't know if that song was originally imported while on the local dri've, but I deleted it and MediaSource imported everything fine.
It was a pain hunting that one song down.
Thanks. -
Problems importing connections from a SAN directory
Is anybody having a problem importing connections from a directory that's on a SAN?
My network is setup so that the Application Data directory is out on a SAN and when SQL Developer opens up the file dialog, current directory is listed as C:\ and entry in the file name field is file://<server>/<path to my stuff>/Application Data/SQL Developer/. This looks fine but when I click on the "Open" button to get the directory listing, an error dialog pops up with the following message:
The directory C:\file:\<server>\<path to my stuff>\Application Data\SQL Developer is not accessible. Please select a different directory.
When I change the current directory to the drive that maps the SAN location, I get the same message only with C: replaced with another drive letter.
If I had to guess, the dialog is not processing the file:// protocol indicator properly before it attempts to get the directory listing. Does anyone have a work around?Other users also had problems with network shares, so you're right that might very well be the cause of your problems.
As workaround, try mapping the settings folder to a local drive. Add this to \sqldeveloper\bin\sqldeveloper.conf:
AddVMOption -Dide.user.dir=C:\sqldeveloperHope that helps,
K. -
Problem Importing photos from camera to iPhoto
Help. For a while I had no problems importing photos from my camera now I get the following error message:- /private/var/folders/CC/CC5eraW2GGCddoAX3DUGjE+TM/-Tmp-/iPhoto/PICT1015.JPG
Does anyone know what this means? What I have done to my computer to cause this? and how to fix it. Thank you.Sam
Welcome to the Apple Discussions.
Launch Image Capture (in your Apps Folder) and use it to move the pics to the desktop. Then try import from there.
If that works, then use your camera to reformat your card, and see if that works in the future.
Regards
TD -
Problem importing users from LDAP (AD) server in administration tool.
Hello,
I have a problem integrating an LDAP server in the Security Manager of the Administration tool.
When trying to import users from an LDAP Server, i receive this error>
"53002 - LDAP server referral is not supported."
[http://download.oracle.com/docs/cd/E05553_01/books/AnyMsg/AnyMsg_Messages22.html]
The configuration of the LDAP server is correct because i receive this message after configuring the connection>
"LDAP Server connected succesfully".
The version of the Oracle Administration Tool is> 10.1.3.4.1.090414.1900
The specifications of the LDAP server are> Active Directory service in Microsoft Windows 2003 Server R2 x64.
Thank you for the Support.Hello,
Please refer to the following KBAs, may be this can helps you:
http://service.sap.com/sap/support/notes/1818711
http://service.sap.com/sap/support/notes/1816595
http://service.sap.com/sap/support/notes/1809036
Regards,
Asma CHAOUACHI -
Problems importing text from EXCEL
Help please!
I'm using CF to import data from an EXCEL sheet that has a
mix of numbers and text onto a SQL Server database. I get a
successful import of numbers, but have problems with the text
import. Specifically, quotes, apostrophes, dashes, etc are
converted to null (?) values--when you output onto a webpage, they
turn into "square boxes". Anyone run into this problem and knows a
fix?
FYI. I can't set up DTS (as some have recommended) since
database server is housed outside my domain.
Also, I would like to keep the format of the text if possible
(ex. breaks, bold, italics, etc.)
Thanks in advance!Some utilities you can use:
SQL Loader:
http://download-east.oracle.com/docs/cd/B14117_01/server.101/b10825/ldr_concepts.htm
External tables:
http://download-east.oracle.com/docs/cd/B14117_01/server.101/b10739/tables.htm#ADMIN01507
Or directly from forms using text_io or cleint_text_io:
http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=f1_help/oraini/c_text_io.html&vtTopicId= -
Problems importing photos from cameras
I have a iPod with video, a photo connector, a Pentax Optio WP and a Canon 350D. When I try to import photos from any of my 2 cameras it may give me the error message "an error occurred while importing". It is more likely the more photos i have to import. Say If I have to import only 10 jpg photos it does it with no problem. However if I import 500MB worth of photos with or without raw i get the error message. Once the error occurred I can't access any of the imported phots, since the menu item is missing then and i can't run any more imports. I have to connect the camera to my PC and delete all import folders to get it working again. I have set up both cameras with PTP/print and always double-check all connections
Any help would be appericiated, Thanks
iPod with Video Windows XPHi Spoottyipod
First off, do a soft reset on your iPod(hold down menu+centre button) this seems to fix most peoples problems. If not.
i've posted this a few times for people on here. The easy way to solve your problem is to buy the Belkin Hi-Speed USB 2.0 15-in-1 Media Card Reader/Writer. model number:F5U249ea.
the reason's you should get this are. 1: it works perfect with the ipod and camera connector and is a little bit faster.
2: your can keep shooting while your saving your shot's.
if still no luck. put the CD that came with your iPod in and use the software updater on there. if you want the latest 1.1.1 go to: http://www.apple.com/ipod/download/
hope this helps you. don't hesitate to ask for any help.
-Mike -
Can any body help me in reading from HTTPS URL
I need to read an HTTPS URL and store the response within a table .
How will I manage to do it from within a servlet using URLConnection and openStream as it does'nt work .
How will JSSE help in this regard .
Since I also need to give the userid and password to get into the file and read the file
https://anyhost.com/readthisfile.html
somnath
Web DeveloperHi,
The Java Secure Socket Extension (JSSE) library from Sun Microsystems lets you access a secure Web server from behind a firewall via
proxy tunneling. To do this, the JSSE application needs to set the https.ProxyHost and https.ProxyPort system properties. The
tunneling code in JSSE checks for "HTTP 1.0" in the proxy's response. If your proxy, like many, returns "HTTP 1.1", you will get an
IOException. In this case, you need to implement your own HTTPS tunneling protocol.
In this article, I will show you how to create a secure socket that tunnels through the firewall, and pass it to the HTTPS stream handler to
open HTTPS URLs using the URLConnection class.
Open the http tunnel socket to the proxy
The first step to creating your secure socket is to open the tunneling socket to the proxy port. The code needed to do this proxy
handshaking can be found in the sample code SSLClientSocketWithTunneling.java that comes with the JSSE distribution. First, a normal socket is created that connects to
the proxy port on the proxy host (line 65). After the socket is created, it is passed to the doTunnelHandshake() method where the proxy's tunneling protocol is called:
54 SSLSocketFactory factory =
55 (SSLSocketFactory)SSLSocketFactory.getDefault();
56
57 /*
58 * Set up a socket to do tunneling through the proxy.
59 * Start it off as a regular socket, then layer SSL
60 * over the top of it.
61 */
62 tunnelHost = System.getProperty("https.proxyHost");
63 tunnelPort = Integer.getInteger("https.proxyPort").intValue();
64
65 Socket tunnel = new Socket(tunnelHost, tunnelPort);
66 doTunnelHandshake(tunnel, host, port);
In doTunnelHandshake(), an http "CONNECT" command is sent to the proxy, with the secure site's hostname and port number as the parameters (line 161). In the original
tunneling code on line 206 in JSSE, it then checks for "HTTP/1.0 200" in the proxy's reply. If your organization's proxy replies with "HTTP 1.1", an IOException will be
thrown. To get around this, the code here checks for the reply "200 Connection Established", which indicates that tunneling is successful (line 207). You can modify the
code to check for the expected corresponding response from your proxy:
139 private void doTunnelHandshake(Socket tunnel, String host, int port)
140 throws IOException
141 {
142 OutputStream out = tunnel.getOutputStream();
143 String msg = "CONNECT " + host + ":" + port + " HTTP/1.0\n"
144 + "User-Agent: "
145 + sun.net.www.protocol.http.HttpURLConnection.userAgent
146 + "\r\n\r\n";
147 byte b[];
148 try {
149 /*
150 * We really do want ASCII7 -- the http protocol doesn't change
151 * with locale.
152 */
153 b = msg.getBytes("ASCII7");
154 } catch (UnsupportedEncodingException ignored) {
155 /*
156 * If ASCII7 isn't there, something serious is wrong, but
157 * Paranoia Is Good (tm)
158 */
159 b = msg.getBytes();
160 }
161 out.write(b);
162 out.flush();
163
164 /*
165 * We need to store the reply so we can create a detailed
166 * error message to the user.
167 */
168 byte reply[] = new byte[200];
169 int replyLen = 0;
170 int newlinesSeen = 0;
171 boolean headerDone = false; /* Done on first newline */
172
173 InputStream in = tunnel.getInputStream();
174 boolean error = false;
175
176 while (newlinesSeen < 2) {
177 int i = in.read();
178 if (i < 0) {
179 throw new IOException("Unexpected EOF from proxy");
180 }
181 if (i == '\n') {
182 headerDone = true;
183 ++newlinesSeen;
184 } else if (i != '\r') {
185 newlinesSeen = 0;
186 if (!headerDone && replyLen < reply.length) {
187 reply[replyLen++] = (byte) i;
188 }
189 }
190 }
191
192 /*
193 * Converting the byte array to a string is slightly wasteful
194 * in the case where the connection was successful, but it's
195 * insignificant compared to the network overhead.
196 */
197 String replyStr;
198 try {
199 replyStr = new String(reply, 0, replyLen, "ASCII7");
200 } catch (UnsupportedEncodingException ignored) {
201 replyStr = new String(reply, 0, replyLen);
202 }
203
204 /* We check for Connection Established because our proxy returns
205 * HTTP/1.1 instead of 1.0 */
206 //if (!replyStr.startsWith("HTTP/1.0 200")) {
207 if(replyStr.toLowerCase().indexOf(
208 "200 connection established") == -1){
209 throw new IOException("Unable to tunnel through "
210 + tunnelHost + ":" + tunnelPort
211 + ". Proxy returns \"" + replyStr + "\"");
212 }
213
214 /* tunneling Handshake was successful! */
215 }
Overlay http tunnel socket with SSL socket
After you have successfully created the tunneling socket, you overlay it with the SSL socket. Again, this is not difficult to do:
54 SSLSocketFactory factory =
55 (SSLSocketFactory)SSLSocketFactory.getDefault();
56
57 /*
58 * Set up a socket to do tunneling through the proxy.
59 * Start it off as a regular socket, then layer SSL
60 * over the top of it.
61 */
62 tunnelHost = System.getProperty("https.proxyHost");
63 tunnelPort = Integer.getInteger("https.proxyPort").intValue();
64
65 Socket tunnel = new Socket(tunnelHost, tunnelPort);
66 doTunnelHandshake(tunnel, host, port);
67
68 /*
69 * Ok, let's overlay the tunnel socket with SSL.
70 */
71 SSLSocket socket =
72 (SSLSocket)factory.createSocket(tunnel, host, port, true);
73
74 /*
75 * register a callback for handshaking completion event
76 */
77 socket.addHandshakeCompletedListener(
78 new HandshakeCompletedListener() {
79 public void handshakeCompleted(
80 HandshakeCompletedEvent event) {
81 System.out.println("Handshake finished!");
82 System.out.println(
83 "\t CipherSuite:" + event.getCipherSuite());
84 System.out.println(
85 "\t SessionId " + event.getSession());
86 System.out.println(
87 "\t PeerHost " + event.getSession().getPeerHost());
88 }
89 }
90 );
The code had called the SSLSocketFactory's getDefault() method earlier to get an instance of the SSLSocketFactory (line 54, repeated above). Next, it passes the
tunneling socket that was created in the previous step to the createSocket() method of the SSLSocketFactory. The createSocket() method returns an SSLSocket that is
connected to the destination host and port via the proxy tunnel. You can optionally add a HandshakeCompletedListener to the socket if you wish to be informed when the
SSL handshaking is completed.
The SSLSocket created is basically ready for use to transfer secure contents. The startHandshake() method is called to start the SSL handshaking (line 98). After which, you
can issue the http "GET" command to retrieve the secure pages (line 105):
91
92 /*
93 * send http request
94 *
95 * See SSLSocketClient.java for more information about why
96 * there is a forced handshake here when using PrintWriters.
97 */
98 socket.startHandshake();
99
100 PrintWriter out = new PrintWriter(
101 new BufferedWriter(
102 new OutputStreamWriter(
103 socket.getOutputStream())));
104
105 out.println("GET http://www.verisign.com/index.html HTTP/1.0");
106 out.println();
107 out.flush();
However, issuing http commands to the tunneling SSL socket to access Webpages is not ideal because it would mean having to rewrite the whole http protocol handler from
scratch. Instead, you should use the HTTPS URL APIs that the JSSE already includes for that purpose. To do this, you have to pass the tunneling SSL socket to the HTTPS URL
stream handler.
Pass SSL socket to HTTPS URL stream handler
The JSSE library has an HttpsURLConnection class that is in the com.sun.net.ssl package, which extends the java.net.URLConnection class. An HttpsURLConnection object
is returned by the URL object's openConnection() method when "HTTPS" is specified as the protocol. The HttpsURLConnection class has a method, setSSLSocketFactory(),
that lets you set an SSLSocketFactory of your choice. To pass the tunneling SSL socket to the HTTPS URL stream handler, you would set the setSSLSocketFactory()
method's parameter with a socket factory that returns the tunneling SSL socket that you created previously.
To do this, you would wrap the code discussed previously in an SSLTunnelSocketFactory class that extends from the SSLSocketFactory class. The SSLSocketFactory is an
abstract class. To extend it, you must implement the createSocket() method to return the tunneling SSL socket that you created earlier:
12 public SSLTunnelSocketFactory(String proxyhost, String proxyport){
13 tunnelHost = proxyhost;
14 tunnelPort = Integer.parseInt(proxyport);
15 dfactory = (SSLSocketFactory)SSLSocketFactory.getDefault();
16 }
44 public Socket createSocket(Socket s, String host, int port,
45 boolean autoClose)
46 throws IOException,UnknownHostException
47 {
48
49 Socket tunnel = new Socket(tunnelHost,tunnelPort);
50
51 doTunnelHandshake(tunnel,host,port);
52
53 SSLSocket result = (SSLSocket)dfactory.createSocket(
54 tunnel,host,port,autoClose);
55
56 result.addHandshakeCompletedListener(
57 new HandshakeCompletedListener() {
58 public void handshakeCompleted(HandshakeCompletedEvent event) {
59 System.out.println("Handshake finished!");
60 System.out.println(
61 "\t CipherSuite:" + event.getCipherSuite());
62 System.out.println(
63 "\t SessionId " + event.getSession());
64 System.out.println(
65 "\t PeerHost " + event.getSession().getPeerHost());
66 }
67 }
68 );
69
70 result.startHandshake();
71
72 return result;
73 }
Notice that the SSLTunnelSocketFactory contains a default SSLSocketFactory object. The default SSLSocketFactory object can be instantiated from a call to the static
method getDefault() (line 15). You need this SSLSocketFactory object to overlay the tunnel socket with the SSL socket, as discussed earlier. You also call the default
object's getDefaultCipherSuites() and getSupportedCipherSuites() methods when implementing the corresponding abstract methods of the SSLSocketFactory super
class. For implementation details, please refer to the complete source code for the SSLTunnelSocketFactory in Resources.
Tunnel through the proxy via URLConnection
To tunnel through the proxy via URLConnection in your JSSE application, after you call the openConnection() method, check if the returned object is that of the
HttpsURLConnection. If so, you instantiate your SSLTunnelSocketFactory object and set it in the setSSLSocketFactory() method (lines 22 through 25):
10 public class URLTunnelReader {
11 private final static String proxyHost = "proxy.sg.ibm.com";
12 private final static String proxyPort = "80";
13
14 public static void main(String[] args) throws Exception {
15 System.setProperty("java.protocol.handler.pkgs",
16 "com.sun.net.ssl.internal.www.protocol");
17 //System.setProperty("https.proxyHost",proxyHost);
18 //System.setProperty("https.proxyPort",proxyPort);
19
20 URL verisign = new URL("https://www.verisign.com");
21 URLConnection urlc = verisign.openConnection(); //from secure site
22 if(urlc instanceof com.sun.net.ssl.HttpsURLConnection){
23 ((com.sun.net.ssl.HttpsURLConnection)urlc).setSSLSocketFactory
24 (new SSLTunnelSocketFactory(proxyHost,proxyPort));
25 }
26
27 BufferedReader in = new BufferedReader(
28 new InputStreamReader(
29 urlc.getInputStream()));
30
31 String inputLine;
32
33 while ((inputLine = in.readLine()) != null)
34 System.out.println(inputLine);
35
36 in.close();
37 }
38 }
You can then access the HTTPS URLs using the APIs provided by the URLConnection class. You don't need to worry about the format of the http GET and POST commands,
which you would if you used the SSL Socket APIs.
The complete source code for the SSLTunnelSocketFactory and the application code that connects to a secure URL using proxy tunneling is included in Resources. To
compile and run the application, you would need to download and install Sun's JSSE from its Website, also listed in Resources.
Conclusion
If your JSSE application could not tunnel through your organization's firewall, you need to implement your own tunneling socket. The sample code included with the JSSE
distribution shows you how to open an SSL socket tunnel. This article goes one step further to show you how to pass the tunneling socket to the HTTPS URL stream handler,
and saves you the trouble of rewriting a http handler
I hope this will help you.
Thanks
Bakrudeen -
Problem importing photos from camera to Lightroom
I have Creative Cloud for Photographers, it´s installed on my iMac and my MacBook Air. I use Lightroom to import photos from the camera. A few days ago I wanted to import some photos to the MacBook, but after a while everything stopped, no photos were imported and after waiting quite some time I gave up. Tried again after a while but then got the message that the files couldn´t be read. It worried me a lot as I was afraid the memory card might have got damaged, but I tried to import the photos to the iMac instead and it was no problem. After that I have tried to import other photos from various cameras to the MacBook, but nothing works. To the iMac - no problem. I then tried to uninstall Lightroom, but it was not possible. In the Creative Cloud-app It is possible to uninstall Photoshop, no problem, but with Lightroom it says "cannot be uninstalled" - on both the iMac and the MacBook.
Since I will be traveling a lot in just a few days, it´s essential to have a Lightroom that works on my MacBook. I usually import photos from the camera several times a day, so without a LR that works, things will be much more difficult…
Any help will be much appreciated!As I am not a Mac person, I cannot explain how to change permissions, but I'm sure your favorite search engine will find the instructions.
Sometimes, the destination folder where Lightroom writes the photos to has accidentally changed, and now you are pointing to a different fodler that doesn't have the proper permissions. -
I have a project wherein a piece of it will require me to retrieve a PDF file from a http URL (i.e.
http://www.somewebsite.com/test.pdf) and print the PDF. I've been looking for examples of how to do this but I'm not finding any. Is the only way to do this download the PDF to disk and then send to a
printer? Speaking of printing, I need to send the PDF to an IP address which I've not done before either. If someone could point me to a good example of that, I'd appreciate it.
Thank you.Since I had access to ABCPDF8, I ended up using it to print the PDF. ABCPDF comes with example projects that helped me figure out what I needed to get the PDF to print. For anyone who also has access to
ABCPDF and needs to use it to print a PDF, I've pasted my code below. The code is a cut-down version of the ABCPDF example as I did not need a lot of the functionality the example had.
Thanks again to all who responded to my post.
ABCPDF8 code:
private static WebSupergoo.ABCpdf8.Doc mDoc = null;
private static System.Drawing.Printing.PrintDocument mPrint = null;
private static int mPage = 0;
private static int mPageSaved = 0;
private static int mCopiesNumber;
private static string pdfFile;
private static string pdfPrinterName;
private static string pdfPrinterTray;
public enum Method
AdobeReader,
ABCPDF8
/// <summary>
/// </summary>
/// <param name="pdfFilePath"></param>
/// <param name="printerName"></param>
/// <param name="printMethod"></param>
public static void DoPrint(string pdfFilePath, string printerName, string printerTray, Method printMethod)
if (System.IO.Path.GetExtension(pdfFilePath).Trim().ToUpper() != ".PDF")
throw new System.ApplicationException(String.Format("File '{0}' is not a PDF!", pdfFilePath));
pdfFile = pdfFilePath;
pdfPrinterName = printerName;
pdfPrinterTray = printerTray;
switch (printMethod)
case Method.AdobeReader:
PrintViaAdobeReader();
break;
case Method.ABCPDF8:
PrintViaABCPDF8();
break;
default:
break;
private static void PrintViaABCPDF8()
mDoc = new WebSupergoo.ABCpdf8.Doc();
//read in the PDF
mDoc.Read(pdfFile);
//crete new print document
mPrint = new System.Drawing.Printing.PrintDocument();
mPrint.DocumentName = System.IO.Path.GetFileName(pdfFile);
mPrint.PrinterSettings.PrinterName = pdfPrinterName;
mPrint.PrinterSettings.FromPage = 1;
mPrint.PrinterSettings.ToPage = mDoc.PageCount;
mPrint.PrinterSettings.MinimumPage = 1;
mPrint.PrinterSettings.MaximumPage = mDoc.PageCount;
mPrint.QueryPageSettings += (sndr, args) =>
if (!String.IsNullOrWhiteSpace(pdfPrinterTray))
for (int i = 0; i < mPrint.PrinterSettings.PaperSources.Count; i++)
if (mPrint.PrinterSettings.PaperSources[i].SourceName.ToLower().Trim() == pdfPrinterTray.ToLower())
args.PageSettings.PaperSource = mPrint.PrinterSettings.PaperSources[i];
break;
mPrint.BeginPrint += new System.Drawing.Printing.PrintEventHandler(DoBeginPrint);
mPrint.EndPrint += new System.Drawing.Printing.PrintEventHandler(DoEndPrint);
mPrint.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(DoPrintPage);
mPrint.Print();
mDoc.Clear();
mDoc.Dispose();
/// <summary>
/// Start printing via ABCPDF8
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private static void DoBeginPrint(object sender, System.Drawing.Printing.PrintEventArgs e)
mPage = mPrint.PrinterSettings.FromPage;
mPageSaved = mDoc.PageNumber;
mCopiesNumber = 1;
/// <summary>
/// Print page using ABCPDF8
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private static void DoPrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
mDoc.PageNumber = mPage;
if (mCopiesNumber++ >= mPrint.PrinterSettings.Copies)
mPage++;
mCopiesNumber = 1;
e.HasMorePages = mPage <= mPrint.PrinterSettings.ToPage;
using (System.Drawing.Graphics g = e.Graphics)
if (mDoc.PageCount == 0) return;
if (mDoc.Page == 0) return;
WebSupergoo.ABCpdf8.XRect cropBox = mDoc.CropBox;
double srcWidth = (cropBox.Width / 72) * 100;
double srcHeight = (cropBox.Height / 72) * 100;
double pageWidth = e.PageBounds.Width;
double pageHeight = e.PageBounds.Height;
double marginX = e.PageSettings.HardMarginX;
double marginY = e.PageSettings.HardMarginY;
double dstWidth = pageWidth - (marginX * 2);
double dstHeight = pageHeight - (marginY * 2);
const bool autoRotate = true;
int rotate = 0;
if (autoRotate && srcWidth != srcHeight && dstWidth != dstHeight
&& (srcWidth > srcHeight) != (dstWidth > dstHeight))
double temp = pageWidth;
pageWidth = pageHeight;
pageHeight = temp;
temp = marginX;
marginX = marginY;
marginY = temp;
temp = dstWidth;
dstWidth = dstHeight;
dstHeight = temp;
rotate = GetPageRotation(mDoc) % 360;
if (rotate <= -180)
rotate += 360;
else if (rotate > 180)
rotate -= 360;
rotate = rotate > 0 ? 90 : -90; // default to -90
// Use -90 because we want the staple to be at a top corner
// of the page. Assuming a rotation of "rotate" (0 or 180 degrees)
// produces upright contents, a rotation of -90 or 90 degrees
// (respectively) produces outputs whose top is at the
// left edge of the portrait page. The staple at the top-left
// corner of the portrait page will be at the top-right corner of the
// contents.
else
rotate = GetPageRotation(mDoc) % 360;
if (rotate != 180 && rotate != -180)
rotate = 0;
// if source bigger than destination then scale
if ((srcWidth > dstWidth) || (srcHeight > dstHeight))
double sx = dstWidth / srcWidth;
double sy = dstHeight / srcHeight;
double s = Math.Min(sx, sy);
srcWidth *= s;
srcHeight *= s;
// now center
double x = (pageWidth - srcWidth) / 2;
double y = (pageHeight - srcHeight) / 2;
// save state
double saveDotsPerInch = mDoc.Rendering.DotsPerInch;
mDoc.Rendering.AutoRotate = false;
System.Drawing.RectangleF theRect = new System.Drawing.RectangleF((float)x, (float)y, (float)srcWidth, (float)srcHeight);
int theRez = e.PageSettings.PrinterResolution.X;
if (e.PageSettings.Color) // color is generally CMYK so to translate from dpi to ppi we divide by four
theRez /= 4;
if (theRez <= 0) // Invalid printer resolution - use the default value
theRez = 72;
// draw content
mDoc.Rect.SetRect(cropBox);
System.Drawing.Drawing2D.Matrix oldTransform = null;
if (rotate != 0)
oldTransform = g.Transform;
switch (rotate)
case 90:
using (System.Drawing.Drawing2D.Matrix matrix = new System.Drawing.Drawing2D.Matrix(0,
1, -1, 0,
(float)(2 * y + srcHeight), 0))
g.MultiplyTransform(matrix);
break;
case -90:
using (System.Drawing.Drawing2D.Matrix matrix = new System.Drawing.Drawing2D.Matrix(0,
-1, 1, 0,
0, (float)(2 * x + srcWidth)))
g.MultiplyTransform(matrix);
break;
case 180:
case -180:
using (System.Drawing.Drawing2D.Matrix matrix = new System.Drawing.Drawing2D.Matrix(-1,
0, 0, -1,
(float)(2 * x + srcWidth), (float)(2 * y +
srcHeight)))
g.MultiplyTransform(matrix);
break;
g.SetClip(theRect);
if (!mDoc.Encryption.CanPrintHi)
mDoc.Rendering.DotsPerInch = 72;
using (System.Drawing.Bitmap bm = mDoc.Rendering.GetBitmap())
g.DrawImage(bm, theRect);
else
mDoc.Rendering.DotsPerInch = theRez;
mDoc.Rendering.ColorSpace = WebSupergoo.ABCpdf8.XRendering.ColorSpaceType.Rgb;
mDoc.Rendering.BitsPerChannel = 8;
byte[] theData = mDoc.Rendering.GetData(".emf");
System.IO.MemoryStream theStream = new System.IO.MemoryStream(theData);
using (System.Drawing.Imaging.Metafile theEMF = new System.Drawing.Imaging.Metafile(theStream))
g.DrawImage(theEMF, theRect);
if (oldTransform != null)
g.Transform = oldTransform;
oldTransform.Dispose();
// restore state
mDoc.Rendering.DotsPerInch = saveDotsPerInch;
mDoc.Rendering.AutoRotate = true;
/// <summary>
/// End printing ABCPDF8
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private static void DoEndPrint(object sender, System.Drawing.Printing.PrintEventArgs e)
mDoc.PageNumber = mPageSaved;
/// <summary>
/// Current page number
/// </summary>
public static int PageNumber
get
if (mDoc == null)
return 0;
else
return mDoc.PageNumber;
set
if (mDoc != null && value <= mDoc.PageCount && value != mDoc.PageNumber)
mDoc.PageNumber = value;
/// <summary>
/// </summary>
/// <param name="theDoc"></param>
/// <returns></returns>
private static int GetPageRotation(WebSupergoo.ABCpdf8.Doc theDoc)
return (theDoc != null) ? theDoc.GetInfoInt(theDoc.Page, "Rotate") : 0; -
Problem importing photos from Extreme Pro SD Card
Sorry if this has been covered. I atempted to import photos from my new CF card via a Griffin card reader into my iMAC. Never had a problem before, but iPhoto won't respond and won't recognize the card. Was able to import to my wife's MacBook Pro with no problem. Any thoughts? Thanks
My appologies for wasting your time. The card reader has given up the ghost!
-
Problem importing music from hdd on my pc
flaming thing wont import music from my hdd's at all...
has happened in the past but am sick of uninstalling and re-installing itunes then importing all music by hand everytime as i have over 200gb of mp3 format music files...
got to be an easy way of sorting this?? p.s has only happened since upgrading to windows 7? problems with itunes or problems with microsoft raping my computer??You need to set the iPod to sync manually. Keep another copy of the music.
(78966) -
Problem importing songs from CD
Every time I import a CD into my iTunes, about 4 seconds into the first track the audio cuts out for a second or two. I've tried re-importing the CDs track-for-track and it still happens.
The problem does not occur when I import other audio files, only when I import directly from a CD.
Any ideas?
Thanks,
RobHave you checked "Use error correction when reading Audio CDs"
Edit->Preferences->Advanced->Importing -
Problem importing photos from iPhoto
I want to import photos from iPhoto. I only want to import photos from two or three albums in iPhoto on my iMac. When I plug in the iPad Air, I choose sync from selected albums. I choose the albums I want to import from and click on "sync" or "apply". When the sync process gets to step 5, "importing photos", it stays on that step never able to proceed to step 6. Is this an iCloud problem? Thanks for your help.
I found out what the problem was. "iCloud Photo Sharing" was turned off on my iPad. Now everything is working great. I would have just deleted the inquiry, but I could not find out how to do that.
Maybe you are looking for
-
How do i save photos in iphoto but not in photo stream
When I take photos with my iphone, it saves a random number to the photo stream. For instance, if I take 5 photos, they all go to the photo stream on my iphone, but on my Mini, one might appear, or more, it is seemingly random. I want to save them
-
Product: HP ENVY Phoenix h9 PC Series Product #: H3Y51AA#BL Model: h9-1387 OS: Windows 8 64-bit Monitors: DELL 2407WFPHC x 2 Updated graphics drivers to latest non-beta version. Hello, Since purchasing my PC a few months ago, there has been one "disp
-
Cant add files to library as soon as i downloaded latest version of itunes.
Hello all - I just upgrading to the latest version of itunes for Windows XP and have had nothing but problems. I download songs and then try the "add file to library" function. and nothing seems to add to my library. has anyone else experienced this
-
How do you backup the contents of your memory card...
I have bought a much larger capacity memory card for my 6680. How can I backup the contents (total) of my old Nokia supplied card ? PC Suite 6.6 fails everytime when I try to use that. Does anyone have any suggestions ?
-
Embed Images in Ill. CS3
When I place a tif, eps, psd image in Illustrator CS3 it automatically embeds the image. How can I stop, I can't seem to find the option to stop.